JuliaLang/julia — pull request #9235 by adolgert (2014-12-03 05:40:54+00:00)
Title: NTuple{Float64,Int} type intersection

Issue https://github.com/JuliaLang/julia/issues/9233

Type intersection for NTuples handles NTuple parameters which are typevars, as in NTuple{T,Int}, or parameters which are explicit, such as NTuple{2,Int}. Type intersection in jltypes.c handles most of the possible combinations correctly. The syntax error, NTuple{Float64,Int}, is an example of a case where all arguments are datatypes, but earlier processing steps haven't expanded the NTuple to a regular tuple. We can catch that by asking whether arguments are typevars in two places.

If the first NTuple parameter is, for instance, a 3, as in NTuple{3,Float32}, then that 3 is assigned a jl_type of jl_is_typevar(). If that is an incorrect assignment, then this bug is better solved at an earlier stage.