From c87bc1cb01352041d7edb057de599cb0ef6ed04a Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Wed, 11 Sep 2024 23:12:50 +0800 Subject: [PATCH] Convert to the right type in similar Signed-off-by: ErikQQY <2283984853@qq.com> --- 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 1588d693..12b9be6b 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -732,7 +732,7 @@ function Base.similar(vec::VectorOfArray{ end @inline function Base.similar(VA::VectorOfArray{T1, N, AT}, ::Type{T2}) where {T1, T2, N, AT <: AbstractArray{<:AbstractArray{T1}}} - eltype(VA.u) <: Vector ? VectorOfArray(similar(VA.u, Vector{T1})) : VectorOfArray(similar(VA.u, Matrix{T1})) + eltype(VA.u) <: Vector ? VectorOfArray(similar(VA.u, Vector{T2})) : VectorOfArray(similar(VA.u, Matrix{T2})) end @inline function Base.similar(VA::VectorOfArray, dims::N) where {N}