Skip to content

Commit 4c415ab

Browse files
committed
[ConstraintSystem] Add missing cases to getLoc(ASTNode)
Recently added `StmtCondition` and `CastLabelItem` wheren't handled at all.
1 parent 573ae9b commit 4c415ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5691,8 +5691,13 @@ SourceLoc constraints::getLoc(ASTNode anchor) {
56915691
return anchor.getStartLoc();
56925692
} else if (auto *S = anchor.dyn_cast<Stmt *>()) {
56935693
return S->getStartLoc();
5694+
} else if (auto *P = anchor.dyn_cast<Pattern *>()) {
5695+
return P->getLoc();
5696+
} else if (auto *C = anchor.dyn_cast<StmtCondition *>()) {
5697+
return C->front().getStartLoc();
56945698
} else {
5695-
return anchor.get<Pattern *>()->getLoc();
5699+
auto *I = anchor.get<CaseLabelItem *>();
5700+
return I->getStartLoc();
56965701
}
56975702
}
56985703

0 commit comments

Comments
 (0)