@@ -65,13 +65,21 @@ protocol CP2 : class { }
65
65
66
66
// Protocol types
67
67
@IBAction func action7( _: P1 ) { } // expected-error{{argument to @IBAction method cannot have non-object type 'P1'}}
68
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
69
+ // expected-note@-2{{protocol 'P1' is not '@objc'}}
68
70
@IBAction func action8( _: CP1 ) { } // expected-error{{argument to @IBAction method cannot have non-object type 'CP1'}}
71
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
72
+ // expected-note@-2{{protocol 'CP1' is not '@objc'}}
69
73
@IBAction func action9( _: OP1 ) { }
70
74
@IBAction func action10( _: P1 ? ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
75
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
71
76
@IBAction func action11( _: CP1 ? ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
77
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
72
78
@IBAction func action12( _: OP1 ? ) { }
73
79
@IBAction func action13( _: P1 ! ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
80
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
74
81
@IBAction func action14( _: CP1 ! ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
82
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
75
83
@IBAction func action15( _: OP1 ! ) { }
76
84
77
85
// Class metatype
@@ -86,18 +94,27 @@ protocol CP2 : class { }
86
94
87
95
// Protocol types
88
96
@IBAction func action21( _: P1 . Type ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
97
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
89
98
@IBAction func action22( _: CP1 . Type ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
99
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
90
100
@IBAction func action23( _: OP1 . Type ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
91
101
@IBAction func action24( _: P1 . Type ? ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
102
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
92
103
@IBAction func action25( _: CP1 . Type ? ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
104
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
93
105
@IBAction func action26( _: OP1 . Type ? ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
94
106
@IBAction func action27( _: P1 . Type ! ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
107
+ //expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
95
108
@IBAction func action28( _: CP1 . Type ! ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
109
+ //expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
96
110
@IBAction func action29( _: OP1 . Type ! ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
97
111
98
112
// Other bad cases
99
113
@IBAction func action30( _: S ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
114
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
115
+ // expected-note@-2{{Swift structs cannot be represented in Objective-C}}
100
116
@IBAction func action31( _: E ) { } // expected-error{{argument to @IBAction method cannot have non-object type}}
101
-
117
+ // expected-error@-1{{method cannot be marked @IBAction because the type of the parameter cannot be represented in Objective-C}}
118
+ // expected-note@-2{{non-'@objc' enums cannot be represented in Objective-C}}
102
119
init ( ) { }
103
120
}
0 commit comments