Commits

Joe Groff committed 72703f84a69
Sema: Typecheck UnresolvedSpecializeExprs. Use UnresolvedSpecializeExprs to set up equality constraints on the opened generic type variables of their subexpressions, and when the system is solved, resolve the expression away to its specialized base expression. Fix the solution logic for DeclRefExprs so that they obtain the type the constraint checker solved for them and not the original unbound type of the decl. This means that constructions and static member accesses of generic types now parse! This also incidentally fixes <rdar://problem/13212959>, so 'A(0)' for generic 'A<T>' now works when T can be inferred from constructor arguments. One thing that doesn't work yet is generics as type members, as in 'A.B<C>' or 'A<B>.C<D>'. The UnresolvedDotExpr for these generates an unbound type variable, and I'm not sure how to express opening a type variable as a generic type $TO<A, B, C>.metatype constraint system in which the thing being specialized is a variable. This patch also doesn't allow explicit specialization of functions; although we could do so in theory, the constraint system that currently gets generated for functions loses the type parameters, so it would require some redesign in the constraint checker. Swift SVN r4047