Skip to content

Commit c83b3c6

Browse files
committed
Improve documentation. Improve sequential scope test case.
1 parent cf273f8 commit c83b3c6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Sources/SwiftLexicalLookup/LookupName.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ import SwiftSyntax
6161
}
6262
}
6363

64+
/// Identifier used for name comparison.
65+
///
6466
/// Note that `self` and `Self` are treated as identifiers for name lookup purposes
6567
/// and that a variable named `self` can shadow the `self` keyword. For example.
66-
///
67-
///
6868
/// ```swift
6969
/// class Foo {
7070
/// func test() {

Tests/SwiftLexicalLookupTest/NameLookupTests.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,18 @@ final class testNameLookup: XCTestCase {
811811
812812
let 4️⃣a = 3
813813
let 5️⃣b = 4
814+
815+
guard let 6️⃣a = b else { return }
814816
815-
print(6️⃣a, 7️⃣b)
817+
print(7️⃣a, 8️⃣b)
816818
}
817819
""",
818820
references: [
819-
"6️⃣": [.fromScope(CodeBlockSyntax.self, expectedNames: ["1️⃣", "4️⃣"])],
820821
"7️⃣": [
822+
.fromScope(GuardStmtSyntax.self, expectedNames: ["6️⃣"]),
823+
.fromScope(CodeBlockSyntax.self, expectedNames: ["1️⃣", "4️⃣"]),
824+
],
825+
"8️⃣": [
821826
.fromScope(CodeBlockSyntax.self, expectedNames: ["5️⃣"]),
822827
.fromScope(GuardStmtSyntax.self, expectedNames: ["3️⃣"]),
823828
.fromScope(CodeBlockSyntax.self, expectedNames: ["2️⃣"]),

0 commit comments

Comments
 (0)