mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Fix latent bug due to unhandled cases in constraints::simplifyLocator()
This commit is contained in:
@@ -3692,6 +3692,10 @@ void constraints::simplifyLocator(ASTNode &anchor,
|
||||
case ConstraintLocator::Condition: {
|
||||
if (auto *condStmt = getAsStmt<LabeledConditionalStmt>(anchor)) {
|
||||
anchor = &condStmt->getCond().front();
|
||||
} else if (auto *whileStmt = getAsStmt<RepeatWhileStmt>(anchor)) {
|
||||
anchor = whileStmt->getCond();
|
||||
} else if (auto *assertStmt = getAsStmt<PoundAssertStmt>(anchor)) {
|
||||
anchor = assertStmt->getCondition();
|
||||
} else {
|
||||
anchor = castToExpr<TernaryExpr>(anchor)->getCondExpr();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user