|
3 | 3 |
|
4 | 4 | @_objcImplementation extension ObjCClass {
|
5 | 5 | // expected-note@-1 {{previously implemented by extension here}}
|
6 |
| - // expected-error@-2 {{extension for main class interface should provide implementation for instance method 'method(fromHeader4:)'}} |
7 |
| - // expected-error@-3 {{extension for main class interface should provide implementation for property 'propertyFromHeader9'}} |
8 |
| - // FIXME: give better diagnostic expected-error@-4 {{extension for main class interface should provide implementation for property 'propertyFromHeader8'}} |
9 |
| - // FIXME: give better diagnostic expected-error@-5 {{extension for main class interface should provide implementation for property 'propertyFromHeader7'}} |
10 |
| - // FIXME: give better diagnostic expected-error@-6 {{extension for main class interface should provide implementation for instance method 'method(fromHeader3:)'}} |
| 6 | + // expected-warning@-2 {{extension for main class interface should provide implementation for instance method 'method(fromHeader4:)'; this will become an error before '@_objcImplementation' is stabilized}} |
| 7 | + // expected-warning@-3 {{extension for main class interface should provide implementation for property 'propertyFromHeader9'; this will become an error before '@_objcImplementation' is stabilized}} |
| 8 | + // FIXME: give better diagnostic expected-warning@-4 {{extension for main class interface should provide implementation for property 'propertyFromHeader8'; this will become an error before '@_objcImplementation' is stabilized}} |
| 9 | + // FIXME: give better diagnostic expected-warning@-5 {{extension for main class interface should provide implementation for property 'propertyFromHeader7'; this will become an error before '@_objcImplementation' is stabilized}} |
| 10 | + // FIXME: give better diagnostic expected-warning@-6 {{extension for main class interface should provide implementation for instance method 'method(fromHeader3:)'; this will become an error before '@_objcImplementation' is stabilized}} |
11 | 11 |
|
12 | 12 | func method(fromHeader1: CInt) {
|
13 | 13 | // OK, provides an implementation for the header's method.
|
|
19 | 19 |
|
20 | 20 | func categoryMethod(fromHeader3: CInt) {
|
21 | 21 | // FIXME: should emit expected-DISABLED-error@-1 {{instance method 'categoryMethod(fromHeader3:)' should be implemented in extension for category 'PresentAdditions', not main class interface}}
|
22 |
| - // FIXME: 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 | + // FIXME: expected-warning@-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?; this will become an error before '@_objcImplementation' is stabilized}} |
23 | 23 | // FIXME: expected-note@-3 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }}
|
24 | 24 | // FIXME: expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
25 | 25 | }
|
|
33 | 33 | }
|
34 | 34 |
|
35 | 35 | func methodNot(fromHeader3: CInt) {
|
36 |
| - // 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-warning@-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?; this will become an error before '@_objcImplementation' is stabilized}} |
37 | 37 | // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }}
|
38 | 38 | // expected-note@-3 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
39 | 39 | }
|
|
94 | 94 | }
|
95 | 95 |
|
96 | 96 | internal var propertyNotFromHeader1: CInt
|
97 |
| - // expected-error@-1 {{property 'propertyNotFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
| 97 | + // expected-warning@-1 {{property 'propertyNotFromHeader1' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?; this will become an error before '@_objcImplementation' is stabilized}} |
98 | 98 | // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible property not declared in the header}} {{3-3=private }}
|
99 | 99 | // expected-note@-3 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }}
|
100 | 100 |
|
|
135 | 135 | }
|
136 | 136 |
|
137 | 137 | func classMethod2(_: CInt) {
|
138 |
| - // expected-error@-1 {{instance method 'classMethod2' does not match class method declared in header}} {{3-3=class }} |
| 138 | + // expected-warning@-1 {{instance method 'classMethod2' does not match class method declared in header; this will become an error before '@_objcImplementation' is stabilized}} {{3-3=class }} |
139 | 139 | }
|
140 | 140 |
|
141 | 141 | func instanceMethod1(_: CInt) {
|
142 | 142 | // OK
|
143 | 143 | }
|
144 | 144 |
|
145 | 145 | class func instanceMethod2(_: CInt) {
|
146 |
| - // expected-error@-1 {{class method 'instanceMethod2' does not match instance method declared in header}} {{3-9=}} |
| 146 | + // expected-warning@-1 {{class method 'instanceMethod2' does not match instance method declared in header; this will become an error before '@_objcImplementation' is stabilized}} {{3-9=}} |
147 | 147 | }
|
148 | 148 | }
|
149 | 149 |
|
150 | 150 | @_objcImplementation(PresentAdditions) extension ObjCClass {
|
151 | 151 | // expected-note@-1 {{previously implemented by extension here}}
|
152 |
| - // expected-error@-2 {{extension for category 'PresentAdditions' should provide implementation for instance method 'categoryMethod(fromHeader4:)'}} |
153 |
| - // FIXME: give better diagnostic expected-error@-3 {{extension for category 'PresentAdditions' should provide implementation for instance method 'categoryMethod(fromHeader3:)'}} |
| 152 | + // expected-warning@-2 {{extension for category 'PresentAdditions' should provide implementation for instance method 'categoryMethod(fromHeader4:)'; this will become an error before '@_objcImplementation' is stabilized}} |
| 153 | + // FIXME: give better diagnostic expected-warning@-3 {{extension for category 'PresentAdditions' should provide implementation for instance method 'categoryMethod(fromHeader3:)'; this will become an error before '@_objcImplementation' is stabilized}} |
154 | 154 |
|
155 | 155 | func method(fromHeader3: CInt) {
|
156 | 156 | // FIXME: should emit expected-DISABLED-error@-1 {{instance method 'method(fromHeader3:)' should be implemented in extension for main class interface, not category 'PresentAdditions'}}
|
157 |
| - // FIXME: 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?}} |
| 157 | + // FIXME: expected-warning@-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?; this will become an error before '@_objcImplementation' is stabilized}} |
158 | 158 | // FIXME: expected-note@-3 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }}
|
159 | 159 | // FIXME: expected-note@-4 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
160 | 160 | }
|
161 | 161 |
|
162 | 162 | var propertyFromHeader7: CInt {
|
163 | 163 | // FIXME: should emit expected-DISABLED-error@-1 {{property 'propertyFromHeader7' should be implemented in extension for main class interface, not category 'PresentAdditions'}}
|
164 |
| - // FIXME: expected-error@-2 {{property 'propertyFromHeader7' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?}} |
| 164 | + // FIXME: expected-warning@-2 {{property 'propertyFromHeader7' does not match any property declared in the headers for 'ObjCClass'; did you use the property's Swift name?; this will become an error before '@_objcImplementation' is stabilized}} |
165 | 165 | // FIXME: expected-note@-3 {{add 'private' or 'fileprivate' to define an Objective-C-compatible property not declared in the header}} {{3-3=private }}
|
166 | 166 | // FIXME: expected-note@-4 {{add 'final' to define a Swift property that cannot be overridden}} {{3-3=final }}
|
167 | 167 | get { return 1 }
|
|
184 | 184 | }
|
185 | 185 |
|
186 | 186 | func categoryMethodNot(fromHeader3: CInt) {
|
187 |
| - // 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?}} |
| 187 | + // expected-warning@-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?; this will become an error before '@_objcImplementation' is stabilized}} |
188 | 188 | // expected-note@-2 {{add 'private' or 'fileprivate' to define an Objective-C-compatible instance method not declared in the header}} {{3-3=private }}
|
189 | 189 | // expected-note@-3 {{add 'final' to define a Swift instance method that cannot be overridden}} {{3-3=final }}
|
190 | 190 | }
|
|
209 | 209 | }
|
210 | 210 |
|
211 | 211 | @_objcImplementation(SwiftNameTests) extension ObjCClass {
|
212 |
| - // expected-error@-1 {{extension for category 'SwiftNameTests' should provide implementation for instance method 'methodSwiftName6B()'}} |
| 212 | + // expected-warning@-1 {{extension for category 'SwiftNameTests' should provide implementation for instance method 'methodSwiftName6B()'; this will become an error before '@_objcImplementation' is stabilized}} |
213 | 213 |
|
214 | 214 | func methodSwiftName1() {
|
215 |
| - // expected-error@-1 {{selector 'methodSwiftName1' for instance method 'methodSwiftName1()' not found in header; did you mean 'methodObjCName1'?}} {{3-3=@objc(methodObjCName1) }} |
| 215 | + // expected-warning@-1 {{selector 'methodSwiftName1' for instance method 'methodSwiftName1()' not found in header; did you mean 'methodObjCName1'?; this will become an error before '@_objcImplementation' is stabilized}} {{3-3=@objc(methodObjCName1) }} |
216 | 216 | }
|
217 | 217 |
|
218 | 218 | @objc(methodObjCName2) func methodSwiftName2() {
|
219 | 219 | // OK
|
220 | 220 | }
|
221 | 221 |
|
222 | 222 | func methodObjCName3() {
|
223 |
| - // expected-error@-1 {{selector 'methodObjCName3' used in header by an instance method with a different name; did you mean 'methodSwiftName3()'?}} {{8-23=methodSwiftName3}} {{3-3=@objc(methodObjCName3) }} |
| 223 | + // expected-warning@-1 {{selector 'methodObjCName3' used in header by an instance method with a different name; did you mean 'methodSwiftName3()'?; this will become an error before '@_objcImplementation' is stabilized}} {{8-23=methodSwiftName3}} {{3-3=@objc(methodObjCName3) }} |
224 | 224 | // FIXME: probably needs an @objc too, since the name is not explicit
|
225 | 225 | }
|
226 | 226 |
|
227 | 227 | @objc(methodWrongObjCName4) func methodSwiftName4() {
|
228 |
| - // expected-error@-1 {{selector 'methodWrongObjCName4' for instance method 'methodSwiftName4()' not found in header; did you mean 'methodObjCName4'?}} {{9-29=methodObjCName4}} |
| 228 | + // expected-warning@-1 {{selector 'methodWrongObjCName4' for instance method 'methodSwiftName4()' not found in header; did you mean 'methodObjCName4'?; this will become an error before '@_objcImplementation' is stabilized}} {{9-29=methodObjCName4}} |
229 | 229 | }
|
230 | 230 |
|
231 | 231 | @objc(methodObjCName5) func methodWrongSwiftName5() {
|
232 |
| - // expected-error@-1 {{selector 'methodObjCName5' used in header by an instance method with a different name; did you mean 'methodSwiftName5()'?}} {{31-52=methodSwiftName5}} |
| 232 | + // expected-warning@-1 {{selector 'methodObjCName5' used in header by an instance method with a different name; did you mean 'methodSwiftName5()'?; this will become an error before '@_objcImplementation' is stabilized}} {{31-52=methodSwiftName5}} |
233 | 233 | }
|
234 | 234 |
|
235 | 235 | @objc(methodObjCName6A) func methodSwiftName6B() {
|
236 |
| - // expected-error@-1 {{selector 'methodObjCName6A' used in header by an instance method with a different name; did you mean 'methodSwiftName6A()'?}} {{32-49=methodSwiftName6A}} |
| 236 | + // expected-warning@-1 {{selector 'methodObjCName6A' used in header by an instance method with a different name; did you mean 'methodSwiftName6A()'?; this will become an error before '@_objcImplementation' is stabilized}} {{32-49=methodSwiftName6A}} |
237 | 237 | }
|
238 | 238 | }
|
239 | 239 |
|
240 | 240 | @_objcImplementation(AmbiguousMethods) extension ObjCClass {
|
241 |
| - // expected-error@-1 {{found multiple implementations that could match instance method 'ambiguousMethod4(with:)' with selector 'ambiguousMethod4WithCInt:'}} |
| 241 | + // expected-warning@-1 {{found multiple implementations that could match instance method 'ambiguousMethod4(with:)' with selector 'ambiguousMethod4WithCInt:'; this will become an error before '@_objcImplementation' is stabilized}} |
242 | 242 |
|
243 | 243 | @objc func ambiguousMethod1(with: CInt) {
|
244 |
| - // expected-error@-1 {{instance method 'ambiguousMethod1(with:)' could match several different members declared in the header}} |
| 244 | + // expected-warning@-1 {{instance method 'ambiguousMethod1(with:)' could match several different members declared in the header; this will become an error before '@_objcImplementation' is stabilized}} |
245 | 245 | // expected-note@-2 {{instance method 'ambiguousMethod1(with:)' (with selector 'ambiguousMethod1WithCInt:') is a potential match; insert '@objc(ambiguousMethod1WithCInt:)' to use it}} {{8-8=(ambiguousMethod1WithCInt:)}}
|
246 | 246 | // expected-note@-3 {{instance method 'ambiguousMethod1(with:)' (with selector 'ambiguousMethod1WithCChar:') is a potential match; insert '@objc(ambiguousMethod1WithCChar:)' to use it}} {{8-8=(ambiguousMethod1WithCChar:)}}
|
247 | 247 | }
|
248 | 248 |
|
249 | 249 | func ambiguousMethod1(with: CChar) {
|
250 |
| - // expected-error@-1 {{instance method 'ambiguousMethod1(with:)' could match several different members declared in the header}} |
| 250 | + // expected-warning@-1 {{instance method 'ambiguousMethod1(with:)' could match several different members declared in the header; this will become an error before '@_objcImplementation' is stabilized}} |
251 | 251 | // expected-note@-2 {{instance method 'ambiguousMethod1(with:)' (with selector 'ambiguousMethod1WithCInt:') is a potential match; insert '@objc(ambiguousMethod1WithCInt:)' to use it}} {{3-3=@objc(ambiguousMethod1WithCInt:) }}
|
252 | 252 | // expected-note@-3 {{instance method 'ambiguousMethod1(with:)' (with selector 'ambiguousMethod1WithCChar:') is a potential match; insert '@objc(ambiguousMethod1WithCChar:)' to use it}} {{3-3=@objc(ambiguousMethod1WithCChar:) }}
|
253 | 253 | }
|
|
258 | 258 |
|
259 | 259 | func ambiguousMethod2(with: CChar) {
|
260 | 260 | // FIXME: OK, matches -ambiguousMethod2WithCChar: because the WithCInt: variant has been eliminated
|
261 |
| - // FIXME: expected-error@-2 {{selector 'ambiguousMethod2With:' for instance method 'ambiguousMethod2(with:)' not found in header; did you mean 'ambiguousMethod2WithCChar:'?}} |
| 261 | + // FIXME: expected-warning@-2 {{selector 'ambiguousMethod2With:' for instance method 'ambiguousMethod2(with:)' not found in header; did you mean 'ambiguousMethod2WithCChar:'?; this will become an error before '@_objcImplementation' is stabilized}} |
262 | 262 | }
|
263 | 263 |
|
264 | 264 | func ambiguousMethod3(with: CInt) {
|
265 |
| - // expected-error@-1 {{instance method 'ambiguousMethod3(with:)' could match several different members declared in the header}} |
| 265 | + // expected-warning@-1 {{instance method 'ambiguousMethod3(with:)' could match several different members declared in the header; this will become an error before '@_objcImplementation' is stabilized}} |
266 | 266 | // expected-note@-2 {{instance method 'ambiguousMethod3(with:)' (with selector 'ambiguousMethod3WithCInt:') is a potential match; insert '@objc(ambiguousMethod3WithCInt:)' to use it}} {{3-3=@objc(ambiguousMethod3WithCInt:) }}
|
267 | 267 | // expected-note@-3 {{instance method 'ambiguousMethod3(with:)' (with selector 'ambiguousMethod3WithCChar:') is a potential match; insert '@objc(ambiguousMethod3WithCChar:)' to use it}} {{3-3=@objc(ambiguousMethod3WithCChar:) }}
|
268 | 268 | }
|
|
292 | 292 | }
|
293 | 293 |
|
294 | 294 | @_objcImplementation(Conformance) extension ObjCClass {
|
295 |
| - // expected-error@-1 {{extension for category 'Conformance' should provide implementation for instance method 'requiredMethod2()'}} |
| 295 | + // expected-warning@-1 {{extension for category 'Conformance' should provide implementation for instance method 'requiredMethod2()'; this will become an error before '@_objcImplementation' is stabilized}} |
296 | 296 | // no-error concerning 'optionalMethod2()'
|
297 | 297 |
|
298 | 298 | func requiredMethod1() {}
|
|
0 commit comments