File tree Expand file tree Collapse file tree 2 files changed +45
-38
lines changed Expand file tree Collapse file tree 2 files changed +45
-38
lines changed Original file line number Diff line number Diff line change @@ -60,41 +60,3 @@ class D : B {
60
60
[ 1 ]
61
61
}
62
62
}
63
-
64
- class Closures : B {
65
- func captureWeak( ) {
66
- let g = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
67
- super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
68
- }
69
- g ( )
70
- }
71
-
72
- func captureUnowned( ) {
73
- let g = { [ unowned self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
74
- super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
75
- }
76
- g ( )
77
- }
78
-
79
- func nestedInner( ) {
80
- let g = { ( ) -> Void in
81
- let h = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
82
- super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
83
- nil ?? super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
84
- }
85
- h ( )
86
- }
87
- g ( )
88
- }
89
-
90
- func nestedOuter( ) {
91
- let g = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
92
- let h = { ( ) -> Void in
93
- super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
94
- nil ?? super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
95
- }
96
- h ( )
97
- }
98
- g ( )
99
- }
100
- }
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ class Base {
4
+ var foo : Int
5
+
6
+ init ( ) { }
7
+ }
8
+
9
+ class Derived : Base {
10
+ func captureWeak( ) {
11
+ let g = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
12
+ super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
13
+ }
14
+ g ( )
15
+ }
16
+
17
+ func captureUnowned( ) {
18
+ let g = { [ unowned self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
19
+ super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
20
+ }
21
+ g ( )
22
+ }
23
+
24
+ func nestedInner( ) {
25
+ let g = { ( ) -> Void in
26
+ let h = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
27
+ super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
28
+ nil ?? super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
29
+ }
30
+ h ( )
31
+ }
32
+ g ( )
33
+ }
34
+
35
+ func nestedOuter( ) {
36
+ let g = { [ weak self] ( ) -> Void in // expected-note * {{'self' explicitly captured here}}
37
+ let h = { ( ) -> Void in
38
+ super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
39
+ nil ?? super. foo ( ) // expected-error {{using 'super' in a closure where 'self' is explicitly captured is not yet supported}}
40
+ }
41
+ h ( )
42
+ }
43
+ g ( )
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments