Skip to content

Commit f470902

Browse files
authored
Merge pull request swiftlang#33492 from rintaro/ide-completion-rdar67102611
[CodeCompletion] Skip an ASTScope assertion for labeled statements
2 parents b1eccb5 + d9a9b59 commit f470902

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
691691
// is equivalent to what we have here.
692692
if (LS->getStartLoc().isValid() && sourceFile &&
693693
SC.getASTContext().LangOpts.EnableASTScopeLookup &&
694-
!SC.getASTContext().Diags.hadAnyError()) {
694+
!SC.getASTContext().Diags.hadAnyError() &&
695+
!SC.LeaveBraceStmtBodyUnchecked) {
695696
// The labeled statements from ASTScope lookup have the
696697
// innermost labeled statement first, so reverse it to
697698
// match the data structure maintained here.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s > /dev/null
2+
3+
for x in "foo" {
4+
if x.#^A^# {
5+
}
6+
}

0 commit comments

Comments
 (0)