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
"'@objc' enum case is not allowed outside of an '@objc' enum", ())
2347
+
ERROR(objc_enum_case_multi,sema_objc,none,
2348
+
"'@objc' enum case declaration defines multiple enum cases with the same Objective-C name", ())
2342
2349
2343
2350
// If you change this, also change enum ObjCReason
2344
2351
#defineOBJC_ATTR_SELECT"select{marked dynamic|marked @objc|marked @IBOutlet|marked @NSManaged|a member of an @objc protocol|implicitly @objc|an @objc override}"
@objc // expected-error {{@objc cannot be applied to this declaration}} {{3-9=}}
197
+
@objc // expected-error {{attribute has no effect; cases within an '@objc' enum are already exposed to Objective-C}} {{3-9=}}
198
198
case subject_enumElement1
199
199
200
+
@objc(subject_enumElement2)
201
+
case subject_enumElement2
202
+
203
+
@objc(subject_enumElement3)
204
+
case subject_enumElement3, subject_enumElement4 // expected-error {{'@objc' enum case declaration defines multiple enum cases with the same Objective-C name}}{{3-8=}}
205
+
206
+
@objc // expected-error {{attribute has no effect; cases within an '@objc' enum are already exposed to Objective-C}} {{3-9=}}
207
+
case subject_enumElement5, subject_enumElement6
208
+
209
+
@nonobjc // expected-error {{@nonobjc cannot be applied to this declaration}}
210
+
case subject_enumElement7
211
+
200
212
@objc
201
213
init(){} // expected-error {{@objc can only be used with members of classes, @objc protocols, and concrete extensions of classes}} {{3-9=}}
202
214
203
215
@objc
204
216
func subject_instanceFunc(){} // expected-error {{@objc can only be used with members of classes, @objc protocols, and concrete extensions of classes}} {{3-8=}}
205
217
}
206
218
219
+
enumsubject_enum2{
220
+
@objc(subject_enum2Element1)
221
+
case subject_enumElement1 // expected-error{{'@objc' enum case is not allowed outside of an '@objc' enum}}{{3-8=}}
222
+
}
223
+
207
224
@objc
208
225
protocolsubject_protocol1{
209
226
@objc
@@ -1752,6 +1769,12 @@ protocol BadProto1 { }
1752
1769
@objc(Enum:) // expected-error{{'@objc' enum must have a simple name}}{{11-12=}}
1753
1770
enumBadEnum1:Int{case X }
1754
1771
1772
+
@objc
1773
+
enumBadEnum2:Int{
1774
+
@objc(X:) // expected-error{{'@objc' enum case must have a simple name}}{{10-11=}}
1775
+
case X
1776
+
}
1777
+
1755
1778
classBadClass2{
1756
1779
@objc(badprop:foo:wibble:) // expected-error{{'@objc' property must have a simple name}}{{16-28=}}
0 commit comments