mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Constrain type checking of expressions in optional pattern bindings
so that they must result in an optional type. Add constraint locator path for identifying constraints/variables that are part of the convert type passed into the system.
This commit is contained in:
@@ -80,6 +80,7 @@ void ConstraintLocator::Profile(llvm::FoldingSetNodeID &id, Expr *anchor,
|
||||
case TypeParameterRequirement:
|
||||
case ImplicitlyUnwrappedDisjunctionChoice:
|
||||
case DynamicLookupResult:
|
||||
case ContextualType:
|
||||
if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) {
|
||||
id.AddInteger(elt.getValue());
|
||||
if (numValues > 1)
|
||||
@@ -258,6 +259,10 @@ void ConstraintLocator::dump(SourceManager *sm, raw_ostream &out) {
|
||||
case DynamicLookupResult:
|
||||
out << "dynamic lookup result";
|
||||
break;
|
||||
|
||||
case ContextualType:
|
||||
out << "contextual type";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user