vect has a stack overflow when trying to compute the element type of the vector.
julia> abstract type A end
julia> struct B <: A end
julia> struct C <: A end
julia> xs = [B() for i in 1:100000];
julia> ys = [C() for i in 1:100000];
julia> [xs..., ys...]
ERROR: StackOverflowError:
Stacktrace:
[1] promote_typeof(::B, ::B, ::Vararg{Any}) (repeats 29076 times)
@ Base ./promotion.jl:330
[2] vect(::B, ::Vararg{Any})
@ Base ./array.jl:144
The workaround is to use vcat, but it would be good if the compiler could figure this out given that the two inputs are known to be vectors. At least to avoid the overflow, promote_typeof could be written:
vect
has a stack overflow when trying to compute the element type of the vector.The workaround is to use
vcat
, but it would be good if the compiler could figure this out given that the two inputs are known to be vectors. At least to avoid the overflow,promote_typeof
could be written:This occurs on 1.7.2: