-
Notifications
You must be signed in to change notification settings - Fork 6
Unpacking optional components throws #500
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
MWE:
julia> using Ark
julia> struct A
x::Float64
end
julia> struct B end
julia> world = World(A, B)
World(entities=0, comp_types=(A, B))
julia> new_entity!(world, (A(1.),))
Entity(2, 0)
julia> q = Query(world, (A,); optional=(B,))
Query((A); optional=(B))
julia> for t in q
@unpack (entities, a, b) = t
end
ERROR: MethodError: no method matching unpack(::Nothing)
Closest candidates are:
unpack(::SubArray)
@ Ark ~/.julia/dev/Ark/src/fieldsview.jl:24
unpack(::FieldViews.FieldViewable{T}) where T
@ Ark ~/.julia/dev/Ark/src/fieldsview.jl:18
unpack(::Ark._StructArrayView)
@ Ark ~/.julia/dev/Ark/src/structarray_interface.jl:152
Stacktrace:
[1] top-level scope
@ ./REPL[14]:2Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working