mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #68344 from hamishknight/do-it
This commit is contained in:
@@ -671,7 +671,8 @@ bool ConstraintLocator::isForSingleValueStmtConjunction() const {
|
||||
}
|
||||
|
||||
bool ConstraintLocator::isForSingleValueStmtConjunctionOrBrace() const {
|
||||
if (!isExpr<SingleValueStmtExpr>(getAnchor()))
|
||||
auto *SVE = getAsExpr<SingleValueStmtExpr>(getAnchor());
|
||||
if (!SVE)
|
||||
return false;
|
||||
|
||||
auto path = getPath();
|
||||
@@ -682,11 +683,17 @@ bool ConstraintLocator::isForSingleValueStmtConjunctionOrBrace() const {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ignore a SyntaticElement path element for a case statement of a switch.
|
||||
// Ignore a SyntaticElement path element for a case statement of a switch,
|
||||
// or the catch of a do-catch, or the brace of a do-statement.
|
||||
if (auto elt = path.back().getAs<LocatorPathElt::SyntacticElement>()) {
|
||||
if (elt->getElement().isStmt(StmtKind::Case)) {
|
||||
path = path.drop_back();
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if (elt->getElement().isStmt(StmtKind::Brace) &&
|
||||
isa<DoCatchStmt>(SVE->getStmt())) {
|
||||
path = path.drop_back();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user