Closed
Description
Since for example Vararg{Any,Int}
throws an error during construction, would it be possible to take advantage of the fact that the N
parameter in a Vararg
is always an Int
in type inference? It would be nice if the following inferred more precisely:
julia> f(::NTuple{N}) where {N} = N
f (generic function with 1 method)
julia> code_warntype(f, Tuple{Tuple})
Variables
#self#::Core.Compiler.Const(f, false)
#unused#::Tuple{Vararg{T,N}} where T where N
Body::Any
1 ─ return $(Expr(:static_parameter, 1))
Sorry if there is an issue about this already, but I couldn't find one.