|
6 | 6 | // expected-note@-1 {{previously implemented by extension here}}
|
7 | 7 |
|
8 | 8 | func method(fromHeader1: CInt) {
|
9 |
| - // FIXME: OK, provides an implementation for the header's method. |
10 |
| - // expected-error@-2 {{instance method 'method(fromHeader1:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}} |
11 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
12 |
| - // expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }} |
| 9 | + // OK, provides an implementation for the header's method. |
13 | 10 | }
|
14 | 11 |
|
15 | 12 | @objc func method(fromHeader2: CInt) {
|
16 | 13 | // OK, provides an implementation for the header's method.
|
17 | 14 | }
|
18 | 15 |
|
19 | 16 | func categoryMethod(fromHeader3: CInt) {
|
20 |
| - // FIXME: Should complain about the wrong category |
21 |
| - // expected-error@-2 {{instance method 'categoryMethod(fromHeader3:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}} |
22 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
23 |
| - // expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }} |
| 17 | + // expected-error@-1 {{instance method 'categoryMethod(fromHeader3:)' should be implemented in extension for category 'PresentAdditions', not main class interface}} |
24 | 18 | }
|
25 | 19 |
|
26 | 20 | @objc fileprivate func methodNot(fromHeader1: CInt) {
|
|
33 | 27 |
|
34 | 28 | func methodNot(fromHeader3: CInt) {
|
35 | 29 | // expected-error@-1 {{instance method 'methodNot(fromHeader3:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}}
|
36 |
| - // expected-note@-2 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
| 30 | + // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }} |
37 | 31 | // expected-note@-3 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
38 | 32 | }
|
39 | 33 |
|
40 | 34 | var propertyFromHeader1: CInt
|
41 |
| - // FIXME: OK, provides an implementation with a stored property |
42 |
| - // expected-error@-2 {{property 'propertyFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
43 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
44 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 35 | + // OK, provides an implementation with a stored property |
45 | 36 |
|
46 | 37 | @objc var propertyFromHeader2: CInt
|
47 | 38 | // OK, provides an implementation with a stored property
|
48 | 39 |
|
49 | 40 | var propertyFromHeader3: CInt {
|
50 |
| - // FIXME: OK, provides an implementation with a computed property |
51 |
| - // expected-error@-2 {{property 'propertyFromHeader3' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
52 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
53 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 41 | + // OK, provides an implementation with a computed property |
54 | 42 | get { return 1 }
|
55 | 43 | set {}
|
56 | 44 | }
|
|
73 | 61 | // FIXME: Should complain about final not fulfilling the @objc requirement
|
74 | 62 |
|
75 | 63 | var readonlyPropertyFromHeader1: CInt
|
76 |
| - // FIXME: OK, provides an implementation with a stored property that's nonpublicly settable |
77 |
| - // expected-error@-2 {{property 'readonlyPropertyFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
78 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
79 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 64 | + // OK, provides an implementation with a stored property that's nonpublicly settable |
80 | 65 |
|
81 | 66 | @objc var readonlyPropertyFromHeader2: CInt
|
82 | 67 | // OK, provides an implementation with a stored property that's nonpublicly settable
|
83 | 68 |
|
84 | 69 | var readonlyPropertyFromHeader3: CInt {
|
85 |
| - // FIXME: OK, provides an implementation with a computed property |
86 |
| - // expected-error@-2 {{property 'readonlyPropertyFromHeader3' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
87 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
88 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 70 | + // OK, provides an implementation with a computed property |
89 | 71 | get { return 1 }
|
90 | 72 | set {}
|
91 | 73 | }
|
|
104 | 86 | get { return 1 }
|
105 | 87 | }
|
106 | 88 |
|
107 |
| - var propertyNotFromHeader1: CInt |
| 89 | + internal var propertyNotFromHeader1: CInt |
108 | 90 | // expected-error@-1 {{property 'propertyNotFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}}
|
109 |
| - // expected-note@-2 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
| 91 | + // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible property not declared in the header}} {{3-3=private }} |
110 | 92 | // expected-note@-3 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }}
|
111 | 93 |
|
112 |
| - @objc var propertyNotFromHeader2: CInt |
| 94 | + @objc private var propertyNotFromHeader2: CInt |
113 | 95 | // OK, provides a nonpublic but ObjC-compatible stored property
|
114 | 96 |
|
115 |
| - @objc var propertyNotFromHeader3: CInt { |
| 97 | + @objc fileprivate var propertyNotFromHeader3: CInt { |
116 | 98 | // OK, provides a nonpublic but ObjC-compatible computed property
|
117 | 99 | get { return 1 }
|
118 | 100 | set {}
|
|
147 | 129 | // expected-note@-1 {{previously implemented by extension here}}
|
148 | 130 |
|
149 | 131 | func method(fromHeader3: CInt) {
|
150 |
| - // FIXME: Should complain about wrong category |
151 |
| - // expected-error@-2 {{instance method 'method(fromHeader3:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}} |
152 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
153 |
| - // expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }} |
| 132 | + // expected-error@-1 {{instance method 'method(fromHeader3:)' should be implemented in extension for main class interface, not category 'PresentAdditions'}} |
154 | 133 | }
|
155 | 134 |
|
156 | 135 | var propertyFromHeader7: CInt {
|
157 |
| - // FIXME: Should complain about wrong category |
158 |
| - // expected-error@-2 {{property 'propertyFromHeader7' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
159 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
160 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 136 | + // expected-error@-1 {{property 'propertyFromHeader7' should be implemented in extension for main class interface, not category 'PresentAdditions'}} |
161 | 137 | get { return 1 }
|
162 | 138 | }
|
163 | 139 |
|
164 | 140 | func categoryMethod(fromHeader1: CInt) {
|
165 |
| - // FIXME: OK, provides an implementation for the header's method. |
166 |
| - // expected-error@-2 {{instance method 'categoryMethod(fromHeader1:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}} |
167 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
168 |
| - // expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }} |
| 141 | + // OK, provides an implementation for the header's method. |
169 | 142 | }
|
170 | 143 |
|
171 | 144 | @objc func categoryMethod(fromHeader2: CInt) {
|
|
182 | 155 |
|
183 | 156 | func categoryMethodNot(fromHeader3: CInt) {
|
184 | 157 | // expected-error@-1 {{instance method 'categoryMethodNot(fromHeader3:)' does not match any instance method declared in the headers for 'ObjCClass'; did you use the instance method's Swift name?}}
|
185 |
| - // expected-note@-2 {{add '@objc' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=@objc }} |
| 158 | + // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }} |
186 | 159 | // expected-note@-3 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
187 | 160 | }
|
188 | 161 |
|
189 | 162 | var categoryPropertyFromHeader1: CInt
|
190 | 163 | // expected-error@-1 {{extensions must not contain stored properties}}
|
191 |
| - // FIXME: expected-error@-2 {{property 'categoryPropertyFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
192 |
| - // FIXME: expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
193 |
| - // FIXME: expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
194 | 164 |
|
195 | 165 | @objc var categoryPropertyFromHeader2: CInt
|
196 | 166 | // expected-error@-1 {{extensions must not contain stored properties}}
|
197 | 167 |
|
198 | 168 | var categoryPropertyFromHeader3: CInt {
|
199 |
| - // FIXME: OK, provides an implementation with a computed property |
200 |
| - // expected-error@-2 {{property 'categoryPropertyFromHeader3' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
201 |
| - // expected-note@-3 {{add '@objc' to define an Objective-C-compatible property not declared in the header}} {{3-3=@objc }} |
202 |
| - // expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }} |
| 169 | + // OK, provides an implementation with a computed property |
203 | 170 | get { return 1 }
|
204 | 171 | set {}
|
205 | 172 | }
|
|
0 commit comments