Skip to content

Commit e71eaae

Browse files
committed
specify method for vcat to avoid ambiguity
1 parent d22a56c commit e71eaae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/array_interface.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ second_axis(::ComponentVector) = FlatAxis()
3333

3434
# Are all these methods necessary?
3535
# TODO: See what we can reduce down to without getting ambiguity errors
36-
Base.vcat(x::ComponentVector, y::AbstractVector) = vcat(getdata(x), y)
37-
Base.vcat(x::AbstractVector, y::ComponentVector) = vcat(x, getdata(y))
36+
Base.vcat(x::ComponentVector{<:Number}, y::AbstractVector{<:Number}) = vcat(getdata(x), y)
37+
Base.vcat(x::AbstractVector{<:Number}, y::ComponentVector{<:Number}) = vcat(x, getdata(y))
3838
function Base.vcat(x::ComponentVector, y::ComponentVector)
3939
if reduce((accum, key) -> accum || (key in keys(x)), keys(y); init=false)
4040
return vcat(getdata(x), getdata(y))
@@ -147,4 +147,4 @@ end
147147
Base.stride(x::ComponentArray, k) = stride(getdata(x), k)
148148
Base.stride(x::ComponentArray, k::Int64) = stride(getdata(x), k)
149149

150-
ArrayInterface.parent_type(::Type{ComponentArray{T,N,A,Axes}}) where {T,N,A,Axes} = A
150+
ArrayInterface.parent_type(::Type{ComponentArray{T,N,A,Axes}}) where {T,N,A,Axes} = A

0 commit comments

Comments
 (0)