diff --git a/src/larray.jl b/src/larray.jl index 66b3cef..239c4bf 100644 --- a/src/larray.jl +++ b/src/larray.jl @@ -270,5 +270,5 @@ function Base.vcat(x::LArray, y::LArray) LArray{(LabelledArrays.symnames(typeof(x))...,LabelledArrays.symnames(typeof(y))...)}(vcat(x.__x,y.__x)) end -Base.elsize(::Type{<:LArray{T}}) where {T} = T +Base.elsize(::Type{<:LArray{T}}) where {T} = sizeof(T) diff --git a/test/larrays.jl b/test/larrays.jl index d019cf1..5411e1a 100644 --- a/test/larrays.jl +++ b/test/larrays.jl @@ -4,6 +4,7 @@ using LabelledArrays, Test, InteractiveUtils vals = [1.0,2.0,3.0] syms = (:a,:b,:c) x = @LArray vals syms + @test Base.elsize(x) == Base.elsize(vals) == 8 @test_nowarn display(x) y = @LVector Float64 (:a,:b,:c) y .= [1,2,3.]