You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>StructArray([nothing, nothing])
ERROR: ArgumentError: only eltypes with fields are supported
Stacktrace:
[1] (StructVector{Nothing, @NamedTuple{}})(c::@NamedTuple{})
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/structarray.jl:17
[2] (StructArray{Nothing})(c::@NamedTuple{})
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/structarray.jl:94
[3] buildfromschema(initializer::StructArrays.var"#28#29"{…}, ::Type{…}, ::Type{…})
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/utils.jl:48
[4] buildfromschema(initializer::StructArrays.var"#28#29"{typeof(StructArrays.alwaysfalse), Vector{Nothing}}, ::Type{Nothing})
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/utils.jl:35
[5] similar_structarray(v::Vector{Nothing}, ::Type{Nothing}; unwrap::typeof(StructArrays.alwaysfalse))
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/structarray.jl:182
[6] StructArray(v::Vector{Nothing}; unwrap::typeof(StructArrays.alwaysfalse))
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/structarray.jl:260
[7] StructArray(v::Vector{Nothing})
@ StructArrays ~/.julia/packages/StructArrays/bgm9N/src/structarray.jl:259
[8] top-level scope
@ REPL[43]:1
Some type information was truncated. Use `show(err)` to see complete types.
This feels like an unnecessary limitation. I have an application where I want to be able to store collections of StructArrays filled with concrete types that may or may not be singleton types. It's inconvenient for me to have to fall back on regular vectors for singleton structs.
Activity
[-]Singleton type support[/-][+]Feature Request: Singleton type support[/+]aplavin commentedon Nov 3, 2025
I also think it would be useful! See an old closed PR of mine: #242.