Closed tkemmer closed 1 month ago
setindex! of abstract table columns fails for values of types not exactly matching eltype, e.g.
setindex!
eltype
Matching type:
julia> atoms().name .= ["test"] # natoms == 1 1-element SystemComponentTableCol{String}: "test"
Compatible but non-matching type:
julia> s = strip(" test") "test" julia> typeof(s), eltype(atoms().name) (SubString{String}, String) julia> atoms().name .= [s] # natoms == 1 ERROR: CanonicalIndexError: setindex! not defined for SystemComponentTableCol{String} Stacktrace: [1] error_if_canonical_setindex(::IndexCartesian, A::SystemComponentTableCol{String}, ::Int64) @ Base ./abstractarray.jl:1406 [2] setindex! @ ./abstractarray.jl:1395 [inlined] [3] macro expansion @ ./broadcast.jl:1004 [inlined] [4] macro expansion @ ./simdloop.jl:77 [inlined] [5] copyto! @ ./broadcast.jl:1003 [inlined] [6] copyto! @ ./broadcast.jl:956 [inlined] [7] materialize! @ ./broadcast.jl:914 [inlined] [8] materialize!(dest::SystemComponentTableCol{…}, bc::Base.Broadcast.Broadcasted{…}) @ Base.Broadcast ./broadcast.jl:911 [9] top-level scope @ REPL[38]:1 Some type information was truncated. Use `show(err)` to see complete types.
setindex!
of abstract table columns fails for values of types not exactly matchingeltype
, e.g.Matching type:
Compatible but non-matching type: