Skip to content

Commit e6bcc15

Browse files
authored
Merge pull request swiftlang#32095 from xedin/add-stmt-to-getLoc
[ConstraintSystem] Add missing handling of `Stmt *` to `getLoc`
2 parents 3befe2f + 9737ce0 commit e6bcc15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4530,6 +4530,8 @@ SourceLoc constraints::getLoc(ASTNode anchor) {
45304530
if (auto VD = dyn_cast<VarDecl>(V))
45314531
return VD->getNameLoc();
45324532
return anchor.getStartLoc();
4533+
} else if (auto *S = anchor.dyn_cast<Stmt *>()) {
4534+
return S->getStartLoc();
45334535
} else {
45344536
return anchor.get<Pattern *>()->getLoc();
45354537
}

0 commit comments

Comments
 (0)