You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Protocol conformance] Simplify/unify checking for @objc/non-@objc conflicts.
When a non-@objc witness matches an @objc requirement except for
@objc-ness, treat it the same way whether it's an optional requirement
or not, except that it's a warning for the optional case. Should
finish off rdar://problem/25159872.
classWobbler:NSWobbling{ // expected-note{{candidate has non-matching type '()'}}
265
265
@objcfunc wobble(){}
266
266
267
-
func returnMyself()->Self{returnself} // expected-error{{non-'@objc' method 'returnMyself()' does not satisfy '@objc' requirement in protocol 'NSWobbling'}}{{3-3=@objc }}
267
+
func returnMyself()->Self{returnself} // expected-error{{non-'@objc' method 'returnMyself()' does not satisfy requirement of '@objc' protocol 'NSWobbling'}}{{3-3=@objc }}
268
268
}
269
269
270
270
extensionWobbler:NSMaybeInitWobble{ // expected-error{{type 'Wobbler' does not conform to protocol 'NSMaybeInitWobble'}}
Copy file name to clipboardExpand all lines: test/decl/protocol/objc.swift
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,9 @@
29
29
}
30
30
31
31
classC1b:P1{
32
-
func method1(){} // expected-error{{non-'@objc' method 'method1()' does not satisfy '@objc' requirement in protocol 'P1'}}{{3-3=@objc }}
33
-
varproperty1:ObjCClass=ObjCClass() // expected-error{{non-'@objc' property 'property1' does not satisfy '@objc' requirement in protocol 'P1'}}{{3-3=@objc }}
34
-
varproperty2:ObjCClass=ObjCClass() // expected-error{{non-'@objc' property 'property2' does not satisfy '@objc' requirement in protocol 'P1'}}{{3-3=@objc }}
32
+
func method1(){} // expected-error{{non-'@objc' method 'method1()' does not satisfy requirement of '@objc' protocol 'P1'}}{{3-3=@objc }}
33
+
varproperty1:ObjCClass=ObjCClass() // expected-error{{non-'@objc' property 'property1' does not satisfy requirement of '@objc' protocol 'P1'}}{{3-3=@objc }}
34
+
varproperty2:ObjCClass=ObjCClass() // expected-error{{non-'@objc' property 'property2' does not satisfy requirement of '@objc' protocol 'P1'}}{{3-3=@objc }}
35
35
}
36
36
37
37
@objcprotocolP2{
@@ -42,9 +42,9 @@ class C1b : P1 {
42
42
}
43
43
44
44
classC2a:P2{
45
-
func method(_:Int, class:ObjCClass){} // expected-error{{non-'@objc' method 'method(_:class:)' does not satisfy '@objc' requirement in protocol 'P2'}}{{3-3=@objc(methodWithInt:withClass:) }}
45
+
func method(_:Int, class:ObjCClass){} // expected-error{{non-'@objc' method 'method(_:class:)' does not satisfy requirement of '@objc' protocol 'P2'}}{{3-3=@objc(methodWithInt:withClass:) }}
46
46
47
-
varempty:Bool{ // expected-error{{non-'@objc' property 'empty' does not satisfy '@objc' requirement in protocol 'P2'}}{{3-3=@objc }}
47
+
varempty:Bool{ // expected-error{{non-'@objc' property 'empty' does not satisfy requirement of '@objc' protocol 'P2'}}{{3-3=@objc }}
48
48
get{}
49
49
}
50
50
}
@@ -103,5 +103,5 @@ class C3a : P3 {
103
103
}
104
104
105
105
classBar:Foo{
106
-
requiredinit(){} // expected-error{{non-'@objc' initializer 'init()' does not satisfy '@objc' requirement in protocol 'Foo'}}{{3-3=@objc }}
106
+
requiredinit(){} // expected-error{{non-'@objc' initializer 'init()' does not satisfy requirement of '@objc' protocol 'Foo'}}{{3-3=@objc }}
0 commit comments