Commits

Doug Gregor committed 1c64358126f
Constraint generation: for each reference to a generic function, replace each archetype with a fresh type variable (that conforms to the same protocols as the archetype) and make the resulting function type monomorphic over those type variables. The resulting constraints provide deduction for the generic parameters, e.g., swift> func ident<T>(x : T) -> T { return x } swift> var x : Int swift> :dump_constraints(ident(x)) ---Constraints for the given expression--- (paren_expr type='T2' (call_expr type='T2' (declref_expr type='(x : T0) -> T0' decl=ident) (paren_expr type='[byref(heap)] Int' (declref_expr type='[byref(heap)] Int' decl=x)))) ---Type Variables--- T0 T1 T2 ---Constraints--- (x : T0) -> T0 == (T1) -> T2 [byref(heap)] Int << T1 Int = 0 Swift SVN r2632