Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve inferrability of [region...]
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}`.
- Loading branch information