jonniedie / ComponentArrays.jl

Arrays with arbitrarily nested named components.
MIT License
287 stars 34 forks source link

`zero` returns different type for `Vector{Bool}` #206

Closed jbrea closed 1 year ago

jbrea commented 1 year ago
julia> x = ComponentVector(NamedTuple{(:a, :b)}([false, true]))
ComponentVector{Bool}(a = false, b = true)

julia> typeof(x)
ComponentVector{Bool, Vector{Bool}, Tuple{Axis{(a = 1, b = 2)}}} (alias for ComponentArray{Bool, 1, Array{Bool, 1}, Tuple{Axis{(a = 1, b = 2)}}})

julia> zero(x)
ComponentVector{Bool, BitVector, Tuple{Axis{(a = 1, b = 2)}}}(a = false, b = false)

julia> typeof(x) == typeof(zero(x))
false
jonniedie commented 1 year ago

Oh interesting. That should be an easy fix. I'll put that in