Skip to content

Commit d90ca22

Browse files
committed
fix stale instances due to AbstractVector
Apparently T[] is an AbstractVector here?
1 parent af27647 commit d90ca22

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/geometry_primitives.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ end
9696
collect_with_eltype(::Type{T}, vec::Vector{T}) where {T} = vec
9797
collect_with_eltype(::Type{T}, vec::AbstractVector{T}) where {T} = collect(vec)
9898
collect_with_eltype(::Type{T}, vec::FaceView{T}) where {T} = vec
99-
collect_with_eltype(::Type{T}, iter) where {T} = collect_with_eltype!(T[], iter)
10099

100+
function collect_with_eltype(::Type{T}, iter) where {T}
101+
return collect_with_eltype!(Vector{T}(undef, 0), iter)
102+
end
101103
function collect_with_eltype(::Type{T}, iter::FaceView) where {T}
102-
return FaceView(collect_with_eltype!(T[], iter.data), iter.faces)
104+
return FaceView(collect_with_eltype!(Vector{T}(undef, 0), iter.data), iter.faces)
103105
end
104106

105107
function collect_with_eltype!(target::AbstractVector{T}, vec::AbstractVector{T}) where {T}

0 commit comments

Comments
 (0)