Skip to content

Commit c456629

Browse files
committed
[NFC] Correct new @objcImpl tests for 5.9
1 parent 694eebf commit c456629

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/decl/ext/objc_implementation.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
}
4040

4141
var methodFromHeader5: CInt
42-
// expected-error@-1 {{property 'methodFromHeader5' does not match the instance method declared by the header}}
42+
// expected-warning@-1 {{property 'methodFromHeader5' does not match the instance method declared by the header}}
4343

4444
func method(fromHeader6: Double) {
45-
// expected-error@-1 {{instance method 'method(fromHeader6:)' of type '(Double) -> ()' does not match type '(Int32) -> Void' declared by the header}}
45+
// expected-warning@-1 {{instance method 'method(fromHeader6:)' of type '(Double) -> ()' does not match type '(Int32) -> Void' declared by the header}}
4646
}
4747

4848
var propertyFromHeader1: CInt
@@ -64,23 +64,23 @@
6464
}
6565

6666
@objc let propertyFromHeader5: CInt
67-
// expected-error@-1 {{property 'propertyFromHeader5' should be settable to match the settable property declared by the header}}
67+
// expected-warning@-1 {{property 'propertyFromHeader5' should be settable to match the settable property declared by the header}}
6868

6969
@objc var propertyFromHeader6: CInt {
70-
// expected-error@-1 {{property 'propertyFromHeader6' should be settable to match the settable property declared by the header}}
70+
// expected-warning@-1 {{property 'propertyFromHeader6' should be settable to match the settable property declared by the header}}
7171
get { return 1 }
7272
}
7373

7474
final var propertyFromHeader8: CInt
7575
// FIXME: Should complain about final not fulfilling the @objc requirement
7676

7777
func propertyFromHeader10() -> CInt {
78-
// expected-error@-1 {{instance method 'propertyFromHeader10()' does not match the property declared by the header}}
78+
// expected-warning@-1 {{instance method 'propertyFromHeader10()' does not match the property declared by the header}}
7979
return 1
8080
}
8181

8282
var propertyFromHeader11: Float
83-
// expected-error@-1 {{property 'propertyFromHeader11' of type 'Float' does not match type 'Int32' declared by the header}}
83+
// expected-warning@-1 {{property 'propertyFromHeader11' of type 'Float' does not match type 'Int32' declared by the header}}
8484

8585
var readonlyPropertyFromHeader1: CInt
8686
// OK, provides an implementation with a stored property that's nonpublicly settable
@@ -154,7 +154,7 @@
154154
}
155155

156156
class func classMethod3(_: Float) {
157-
// expected-error@-1 {{class method 'classMethod3' of type '(Float) -> ()' does not match type '(Int32) -> Void' declared by the header}}
157+
// expected-warning@-1 {{class method 'classMethod3' of type '(Float) -> ()' does not match type '(Int32) -> Void' declared by the header}}
158158
}
159159

160160
func instanceMethod1(_: CInt) {
@@ -325,15 +325,15 @@
325325
func nullUnspecifiedResultAndArg(_: Any!) -> Any! { fatalError() } // no-error
326326

327327
func nonnullResult1() -> Any { fatalError() } // no-error
328-
func nonnullResult2() -> Any? { fatalError() } // expected-error {{instance method 'nonnullResult2()' of type '() -> Any?' does not match type '() -> Any' declared by the header}}
328+
func nonnullResult2() -> Any? { fatalError() } // expected-warning {{instance method 'nonnullResult2()' of type '() -> Any?' does not match type '() -> Any' declared by the header}}
329329
func nonnullResult3() -> Any! { fatalError() } // no-error (special case)
330330

331331
func nonnullArgument1(_: Any) {} // no-error
332-
func nonnullArgument2(_: Any?) {} // expected-error {{instance method 'nonnullArgument2' of type '(Any?) -> ()' does not match type '(Any) -> Void' declared by the header}}
332+
func nonnullArgument2(_: Any?) {} // expected-warning {{instance method 'nonnullArgument2' of type '(Any?) -> ()' does not match type '(Any) -> Void' declared by the header}}
333333
func nonnullArgument3(_: Any!) {} // no-error (special case)
334334

335-
func nullableResult() -> Any { fatalError() } // expected-error {{instance method 'nullableResult()' of type '() -> Any' does not match type '() -> Any?' declared by the header}}
336-
func nullableArgument(_: Any) {} // expected-error {{instance method 'nullableArgument' of type '(Any) -> ()' does not match type '(Any?) -> Void' declared by the header}}
335+
func nullableResult() -> Any { fatalError() } // expected-warning {{instance method 'nullableResult()' of type '() -> Any' does not match type '() -> Any?' declared by the header}}
336+
func nullableArgument(_: Any) {} // expected-warning {{instance method 'nullableArgument' of type '(Any) -> ()' does not match type '(Any?) -> Void' declared by the header}}
337337

338338
func nonPointerResult() -> CInt! { fatalError() } // expected-error{{method cannot be implicitly @objc because its result type cannot be represented in Objective-C}}
339339
func nonPointerArgument(_: CInt!) {} // expected-error {{method cannot be implicitly @objc because the type of the parameter cannot be represented in Objective-C}}

0 commit comments

Comments
 (0)