From e71eaaeeb15134fff8abf99c817190d778ba116d Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Mon, 30 Oct 2023 17:54:18 -0400 Subject: [PATCH] specify method for vcat to avoid ambiguity --- src/array_interface.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/array_interface.jl b/src/array_interface.jl index 745dde5a..e82c6e29 100644 --- a/src/array_interface.jl +++ b/src/array_interface.jl @@ -33,8 +33,8 @@ second_axis(::ComponentVector) = FlatAxis() # Are all these methods necessary? # TODO: See what we can reduce down to without getting ambiguity errors -Base.vcat(x::ComponentVector, y::AbstractVector) = vcat(getdata(x), y) -Base.vcat(x::AbstractVector, y::ComponentVector) = vcat(x, getdata(y)) +Base.vcat(x::ComponentVector{<:Number}, y::AbstractVector{<:Number}) = vcat(getdata(x), y) +Base.vcat(x::AbstractVector{<:Number}, y::ComponentVector{<:Number}) = vcat(x, getdata(y)) function Base.vcat(x::ComponentVector, y::ComponentVector) if reduce((accum, key) -> accum || (key in keys(x)), keys(y); init=false) return vcat(getdata(x), getdata(y)) @@ -147,4 +147,4 @@ end Base.stride(x::ComponentArray, k) = stride(getdata(x), k) Base.stride(x::ComponentArray, k::Int64) = stride(getdata(x), k) -ArrayInterface.parent_type(::Type{ComponentArray{T,N,A,Axes}}) where {T,N,A,Axes} = A \ No newline at end of file +ArrayInterface.parent_type(::Type{ComponentArray{T,N,A,Axes}}) where {T,N,A,Axes} = A