Skip to content

Commit e7c8469

Browse files
committed
Unified: Add tests for explicit self/Self qualifiers
1 parent e452286 commit e7c8469

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
private class A {
2+
let x = 123 // name=A.instance.x
3+
4+
func getX() {
5+
return self.x // not handled by static name binding
6+
}
7+
8+
static let y = 456 // name=A.type.y
9+
10+
func getY1() {
11+
return Self.y // $ MISSING: access=A access=A.type.y
12+
}
13+
14+
static func getY2() {
15+
return self.y // $ not handled by static name binding
16+
}
17+
18+
class func z() -> Int { // name=A.type.z
19+
return 789
20+
}
21+
22+
class func getZ() {
23+
return self.z // $ not handled by static name binding
24+
}
25+
}
26+
27+
private class B : A { // $ access=A
28+
func getX2() {
29+
return self.x // not handled by static name binding
30+
}
31+
32+
func getY3() {
33+
return Self.y // $ MISSING: access=B access=A.type.y
34+
}
35+
36+
static func getY4() {
37+
return self.y // $ not handled by static name binding
38+
}
39+
40+
class func z() -> Int { // name=B.type.z
41+
return 789
42+
}
43+
44+
class func getZ2() {
45+
return self.z // $ not handled by static name binding
46+
}
47+
}

0 commit comments

Comments
 (0)