Handling ExplicityCoercion in simplifyLocator

This commit is contained in:
Luciano Almeida
2019-10-24 00:27:53 -03:00
parent a92e62f51f
commit 3dc82a6271
2 changed files with 6 additions and 7 deletions

View File

@@ -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.

View File

@@ -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;