Skip to content

Commit 0e5009a

Browse files
committed
Fix merge artifacts.
1 parent e96a324 commit 0e5009a

File tree

3 files changed

+4
-38
lines changed

3 files changed

+4
-38
lines changed

Sources/SwiftLexicalLookup/ScopeImplementations.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,10 @@ import SwiftSyntax
103103
state: LookupState
104104
) -> [LookupResult] {
105105
switch config.fileScopeHandling {
106-
case .codeBlock:
107-
return sequentialLookup(
108-
in: statements,
109-
for: name,
110-
at: syntax,
111-
with: config,
112-
state: state,
113-
createResultsForThisScopeWith: { .fromFileScope(self, withNames: $0) }
114-
)
115106
case .memberBlock:
116107
let names = introducedNames(using: .memberBlock)
117108
.filter { lookupName in
118-
does(name: name, referTo: lookupName, at: syntax)
109+
checkName(name, refersTo: lookupName, at: syntax)
119110
}
120111

121112
return names.isEmpty ? [] : [.fromFileScope(self, withNames: names)]
@@ -133,7 +124,7 @@ import SwiftSyntax
133124
if item.is(DeclSyntax.self) || item.is(VariableDeclSyntax.self) {
134125
let foundNames = LookupName.getNames(from: item)
135126

136-
members.append(contentsOf: foundNames.filter { does(name: name, referTo: $0, at: syntax) })
127+
members.append(contentsOf: foundNames.filter { checkName(name, refersTo: $0, at: syntax) })
137128
} else {
138129
encounteredNonDeclaration = true
139130
sequentialItems.append(codeBlockItem)
@@ -319,7 +310,7 @@ import SwiftSyntax
319310
let names = conditions.flatMap { element in
320311
LookupName.getNames(from: element.condition, accessibleAfter: element.endPosition)
321312
}.filter { introducedName in
322-
does(name: name, referTo: introducedName, at: syntax)
313+
checkName(name, refersTo: introducedName, at: syntax)
323314
}
324315

325316
return names.isEmpty ? [] : [.fromScope(self, withNames: names)]

Sources/SwiftLexicalLookup/SequentialScopeSyntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extension SequentialScopeSyntax {
7575
from: codeBlockItem.item,
7676
accessibleAfter: codeBlockItem.endPosition
7777
).filter { introducedName in
78-
does(name: name, referTo: introducedName, at: syntax)
78+
checkName(name, refersTo: introducedName, at: syntax)
7979
}
8080
)
8181
}

Tests/SwiftLexicalLookupTest/NameLookupTests.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -604,31 +604,6 @@ final class testNameLookup: XCTestCase {
604604
)
605605
}
606606

607-
func testGuardOnFileScopeCodeBlock() {
608-
assertLexicalNameLookup(
609-
source: """
610-
let 1️⃣a = 0
611-
612-
class c {}
613-
614-
guard let 2️⃣a else { fatalError() }
615-
616-
3️⃣class a {}
617-
618-
let x = 4️⃣a
619-
""",
620-
references: [
621-
"4️⃣": [
622-
.fromFileScope(expectedNames: ["3️⃣"]),
623-
.fromScope(GuardStmtSyntax.self, expectedNames: ["2️⃣"]),
624-
.fromFileScope(expectedNames: ["1️⃣"]),
625-
]
626-
],
627-
expectedResultTypes: .all(IdentifierPatternSyntax.self, except: ["3️⃣": ClassDeclSyntax.self]),
628-
config: LookupConfig(fileScopeHandling: .codeBlock)
629-
)
630-
}
631-
632607
func testImplicitSelf() {
633608
assertLexicalNameLookup(
634609
source: """

0 commit comments

Comments
 (0)