mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Handling ExplicityCoercion in simplifyLocator
This commit is contained in:
@@ -159,13 +159,7 @@ protected:
|
||||
}
|
||||
|
||||
/// \returns true is locator hasn't been simplified down to expression.
|
||||
bool hasComplexLocator() const {
|
||||
bool isExplicitCoercion =
|
||||
getLocator()
|
||||
->isLastElement<
|
||||
ConstraintLocator::PathElement::ExplicitTypeCoercion>();
|
||||
return HasComplexLocator && !isExplicitCoercion;
|
||||
}
|
||||
bool hasComplexLocator() const { return HasComplexLocator; }
|
||||
|
||||
/// \returns A parent expression if sub-expression is contained anywhere
|
||||
/// in the root expression or `nullptr` otherwise.
|
||||
|
||||
@@ -2998,6 +2998,11 @@ void constraints::simplifyLocator(Expr *&anchor,
|
||||
continue;
|
||||
}
|
||||
|
||||
case ConstraintLocator::ExplicitTypeCoercion: {
|
||||
path = path.slice(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
default:
|
||||
// FIXME: Lots of other cases to handle.
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user