You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes the following problem:
```julia
julia> docat(v) = [v...]
docat (generic function with 1 method)
julia> code_typed(docat, (UnitRange{Int},))
1-element Vector{Any}:
CodeInfo(
1 ─ %1 = Core._apply_iterate(Base.iterate, Base.vect, v)::Vector{_A} where _A
└── return %1
) => Vector{_A} where _A
julia> code_typed(docat, (Vector{Int},))
1-element Vector{Any}:
CodeInfo(
1 ─ %1 = Core._apply_iterate(Base.iterate, Base.vect, v)::Union{Vector{Any}, Vector{Int64}}
└── return %1
) => Union{Vector{Any}, Vector{Int64}}
```
Essentially, because `region...` is implemented via the parser,
it relies on the call `vect(args...)` and the risk is that `args`
might be empty, which causes it to return `Vector{Any}`.
0 commit comments