Skip to content

Commit 92d11c2

Browse files
author
Pietro Vertechi
committed
fix convert ambiguity
1 parent bd70bc1 commit 92d11c2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/structarray.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ end
5959
StructArray(s::StructArray) = copy(s)
6060

6161
Base.convert(::Type{StructArray}, v::AbstractArray) = StructArray(v)
62+
Base.convert(::Type{StructArray}, v::StructArray) = v
6263

6364
function Base.similar(::Type{StructArray{T, N, C}}, sz::Dims) where {T, N, C}
6465
cols = map_params(typ -> similar(typ, sz), C)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ end
110110
@test t2 == t
111111
t3 = StructArray(t)::StructArray
112112
@test t3 == t
113+
@test convert(StructArray, t) == t
113114
end
114115

115116
@testset "tuple case" begin

0 commit comments

Comments
 (0)