Skip to content

Commit 81fc342

Browse files
committed
ASTScope: Ignore PatternEntryDeclScope when searching for statement labels
1 parent 5c877c5 commit 81fc342

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/swift/AST/ASTScope.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
10791079

10801080
protected:
10811081
bool lookupLocalsOrMembers(DeclConsumer) const override;
1082+
bool isLabeledStmtLookupTerminator() const override;
10821083
};
10831084

10841085
class PatternEntryInitializerScope final : public AbstractPatternEntryScope {

lib/AST/ASTScopeLookup.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ bool CaseStmtBodyScope::isLabeledStmtLookupTerminator() const {
510510
return false;
511511
}
512512

513+
bool PatternEntryDeclScope::isLabeledStmtLookupTerminator() const {
514+
return false;
515+
}
516+
513517
llvm::SmallVector<LabeledStmt *, 4>
514518
ASTScopeImpl::lookupLabeledStmts(SourceFile *sourceFile, SourceLoc loc) {
515519
// Find the innermost scope from which to start our search.

0 commit comments

Comments
 (0)