Skip to content

Commit 9584c99

Browse files
Merge pull request #112 from chriselrod/elsize
Fix and properly test elsize
2 parents 8de79b0 + 2ace707 commit 9584c99

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/larray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,5 +270,5 @@ function Base.vcat(x::LArray, y::LArray)
270270
LArray{(LabelledArrays.symnames(typeof(x))...,LabelledArrays.symnames(typeof(y))...)}(vcat(x.__x,y.__x))
271271
end
272272

273-
Base.elsize(::Type{<:LArray{T}}) where {T} = T
273+
Base.elsize(::Type{<:LArray{T}}) where {T} = sizeof(T)
274274

test/larrays.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using LabelledArrays, Test, InteractiveUtils
44
vals = [1.0,2.0,3.0]
55
syms = (:a,:b,:c)
66
x = @LArray vals syms
7+
@test Base.elsize(x) == Base.elsize(vals) == 8
78
@test_nowarn display(x)
89
y = @LVector Float64 (:a,:b,:c)
910
y .= [1,2,3.]

0 commit comments

Comments
 (0)