Skip to content

Commit 3dc82a6

Browse files
Handling ExplicityCoercion in simplifyLocator
1 parent a92e62f commit 3dc82a6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/Sema/CSDiagnostics.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,7 @@ class FailureDiagnostic {
159159
}
160160

161161
/// \returns true is locator hasn't been simplified down to expression.
162-
bool hasComplexLocator() const {
163-
bool isExplicitCoercion =
164-
getLocator()
165-
->isLastElement<
166-
ConstraintLocator::PathElement::ExplicitTypeCoercion>();
167-
return HasComplexLocator && !isExplicitCoercion;
168-
}
162+
bool hasComplexLocator() const { return HasComplexLocator; }
169163

170164
/// \returns A parent expression if sub-expression is contained anywhere
171165
/// in the root expression or `nullptr` otherwise.

lib/Sema/ConstraintSystem.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,11 @@ void constraints::simplifyLocator(Expr *&anchor,
29972997
path = path.slice(1);
29982998
continue;
29992999
}
3000+
3001+
case ConstraintLocator::ExplicitTypeCoercion: {
3002+
path = path.slice(1);
3003+
continue;
3004+
}
30003005

30013006
default:
30023007
// FIXME: Lots of other cases to handle.

0 commit comments

Comments
 (0)