Skip to content

Commit 2a85acb

Browse files
[ConstraintLocator] Adjust isCoerce() to check for LocatorPathElt::ExplicitTypeCoercion path
1 parent f66405c commit 2a85acb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/ConstraintLocator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ bool ConstraintLocator::isForAssignment() const {
197197
}
198198

199199
bool ConstraintLocator::isForCoercion() const {
200-
return directlyAt<CoerceExpr>();
200+
return isLastElement<LocatorPathElt::ExplicitTypeCoercion>() ||
201+
directlyAt<CoerceExpr>();
201202
}
202203

203204
bool ConstraintLocator::isForOptionalTry() const {

0 commit comments

Comments
 (0)