Commits

Doug Gregor committed 4b9efc5acc4
Introduce the notion of an 'unknowable' coercion result, for cases where it is possible that the coercion will be well-formed, but we don't know because there are subexpressions that don't have types, e.g., a literal. When we come by later and resolve literals, the unknowable may become knowable. This is the skeleton of <rdar://problem/11445907>, but there is still work to do to ensure that we only get unknowable results when we truly can't know (which has a major effect on overloading) and to push unknowable checking further into the type checker. This change allows us to eliminate the hack wherein a literal would be coerced to protocol type by directly using the default type for that literal. Instead, the result is simply unknowable, and resolution of literals to their default literal types will perform the type checking later. Finally, we now give type coercion expressions, e.g., Int(blah) the type of the thing we're coercing to, even if the coercion to or construction of Int from blah is unknowable, which aids type checking. Swift SVN r2181