Skip to content

Commit

Permalink
Merge pull request #112 from chriselrod/elsize
Browse files Browse the repository at this point in the history
Fix and properly test elsize
  • Loading branch information
ChrisRackauckas authored Feb 28, 2022
2 parents 8de79b0 + 2ace707 commit 9584c99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/larray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

1 change: 1 addition & 0 deletions test/larrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.]
Expand Down

0 comments on commit 9584c99

Please sign in to comment.