From 89383b4933d0225b43d3355123f33e36173bd392 Mon Sep 17 00:00:00 2001 From: Alex Ames Date: Mon, 5 Jul 2021 18:04:27 -0500 Subject: [PATCH] Broaden vector eltype signature for `push!` Pushing to `AbstractVectorOfArray` is currently limited to vectors with eltype `AbstractVector`, which seems likely to have been a too-restrictive oversight. This PR broadens the accepted eltype to `AbstractArray`. --- src/vector_of_array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index 615dc793..2f3e07e5 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -169,7 +169,7 @@ Base.copy(VA::AbstractDiffEqArray) = typeof(VA)( ) Base.copy(VA::AbstractVectorOfArray) = typeof(VA)(copy(VA.u)) Base.sizehint!(VA::AbstractVectorOfArray{T, N}, i) where {T, N} = sizehint!(VA.u, i) -Base.push!(VA::AbstractVectorOfArray{T, N}, new_item::AbstractVector) where {T, N} = push!(VA.u, new_item) +Base.push!(VA::AbstractVectorOfArray{T, N}, new_item::AbstractArray) where {T, N} = push!(VA.u, new_item) function Base.append!(VA::AbstractVectorOfArray{T, N}, new_item::AbstractVectorOfArray{T, N}) where {T, N} for item in copy(new_item)