Commits

Doug Gregor committed 31e7be143a5
Introduce support for the type coercion syntax T(x) where T is the name of a type. This syntax either coerces 'x' to the type T or, failing that, enumerates the constructors of T and invokes one of them. Note that, syntactically, this coercion is syntactically identical to a function application f(x) We distinguish these cases with a simple, syntax-based scheme: if the 'function' subexpression of the application can be trivially determined to have metatype type, then we consider this a construction. Otherwise, we assume that it's a function application. This disallows some crazy coercions---e.g., those that involve overloaded variables of metatype type---but should feel fairly intuitive, and it keeps the constraint systems simpler. Swift SVN r2802