Skip to content

Commit 9ce4785

Browse files
committed
unified: Auto-format self_access.swift
1 parent a021112 commit 9ce4785

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

‎unified/ql/test/library-tests/local-name-binding/self_access.swift‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
class C {
2-
func t1() { // implicit-self=t1.self
3-
print(self) // $ access=t1.self
2+
func t1() { // implicit-self=t1.self
3+
print(self) // $ access=t1.self
44
}
55

6-
var instanceField = 123;
6+
var instanceField = 123
77

8-
func t2() { // implicit-self=t2.self
9-
print(instanceField) // $ access=instanceField implicit-qualifier=t2.self
8+
func t2() { // implicit-self=t2.self
9+
print(instanceField) // $ access=instanceField implicit-qualifier=t2.self
1010
}
1111

12-
func t3() { // implicit-self=t3.self
13-
foo(123) { [self] in // $ captured=closure.self access=t3.self // name=closure.self
14-
print(self) // $ access=closure.self
15-
print(instanceField) // $ access=instanceField implicit-qualifier=closure.self
12+
func t3() { // implicit-self=t3.self
13+
foo(123) { [self] in // $ captured=closure.self access=t3.self // name=closure.self
14+
print(self) // $ access=closure.self
15+
print(instanceField) // $ access=instanceField implicit-qualifier=closure.self
1616
}
1717
}
1818

19-
func t4() { // implicit-self=t4.self
20-
foo(123) { [weak self] in // $ captured=weak.self access=t4.self // name=weak.self
19+
func t4() { // implicit-self=t4.self
20+
foo(123) { [weak self] in // $ captured=weak.self access=t4.self // name=weak.self
2121
// Here, 'self' is an Option<C> referring to .some(<outer self>) if it
2222
// has not been GC'ed yet. Swift does not allow unqualified self access here.
2323

24-
print(self) // $ access=weak.self
24+
print(self) // $ access=weak.self
2525

2626
// Unwrap the 'self' optional to get a strong reference.
27-
guard let self else { return } // $ access=weak.self // name=guarded.self
27+
guard let self else { return } // $ access=weak.self // name=guarded.self
2828

29-
print(self) // $ access=guarded.self
30-
print(instanceField) // $ access=instanceField implicit-qualifier=guarded.self
29+
print(self) // $ access=guarded.self
30+
print(instanceField) // $ access=instanceField implicit-qualifier=guarded.self
3131
}
3232
}
3333

0 commit comments

Comments
 (0)