mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In "x as T", type-check the subexpression "x" using "T" as the context type.
Using "T" as the contextual type, either for an implicit conversion (in the coercion case) or as a downcast (for the checked-cast case), opens up more type-inference opportunities. Most importantly, it allows coercions such as "1 as UInt32" (important for <rdar://problem/15283100>). Additionally, it allows one to omit generic arguments within the type we're casting to. Some additional cleanup to follow. Swift SVN r10799
This commit is contained in:
@@ -54,6 +54,7 @@ gatherReferencedTypeVarsRec(ConstraintSystem &cs,
|
||||
case ConstraintKind::Bind:
|
||||
case ConstraintKind::Construction:
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::Equal:
|
||||
case ConstraintKind::Subtype:
|
||||
case ConstraintKind::TrivialSubtype:
|
||||
|
||||
Reference in New Issue
Block a user