Skip to content

Commit 3559274

Browse files
committed
Change "enum element" to "enum case" in diagnostics
From the perspective of the compiler implementation, they're elements. But users will think of these as cases—and many diagnostics already refer to these as enum cases.
1 parent 436b861 commit 3559274

File tree

9 files changed

+48
-48
lines changed

9 files changed

+48
-48
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ ERROR(could_not_use_type_member_on_instance,none,
117117
"static member %1 cannot be used on instance of type %0",
118118
(Type, DeclName))
119119
ERROR(could_not_use_enum_element_on_instance,none,
120-
"enum element %0 cannot be referenced as an instance member",
120+
"enum case %0 cannot be used as an instance member",
121121
(DeclName))
122122
ERROR(could_not_use_type_member_on_protocol_metatype,none,
123123
"static member %1 cannot be used on protocol metatype %0",

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ StringRef Decl::getDescriptiveKindName(DescriptiveDeclKind K) {
279279
ENTRY(MaterializeForSet, "materializeForSet accessor");
280280
ENTRY(Addressor, "address accessor");
281281
ENTRY(MutableAddressor, "mutableAddress accessor");
282-
ENTRY(EnumElement, "enum element");
282+
ENTRY(EnumElement, "enum case");
283283
ENTRY(Module, "module");
284284
ENTRY(MissingMember, "missing member placeholder");
285285
ENTRY(Requirement, "requirement");

test/Compatibility/tuple_arguments_4.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ do {
633633
_ = Enum.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
634634
_ = Enum.two(3 > 4 ? 3 : 4) // expected-error {{missing argument for parameter #2 in call}}
635635

636-
_ = Enum.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
636+
_ = Enum.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
637637
_ = Enum.tuple((3, 4))
638638

639-
_ = Enum.labeledTuple(x: 3, 4) // expected-error {{enum element 'labeledTuple' expects a single parameter of type '(Int, Int)'}}
639+
_ = Enum.labeledTuple(x: 3, 4) // expected-error {{enum case 'labeledTuple' expects a single parameter of type '(Int, Int)'}}
640640
_ = Enum.labeledTuple(x: (3, 4))
641641
}
642642

@@ -649,7 +649,7 @@ do {
649649
_ = Enum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
650650
_ = Enum.two(c) // expected-error {{missing argument for parameter #2 in call}}
651651

652-
_ = Enum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
652+
_ = Enum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
653653
_ = Enum.tuple((a, b))
654654
_ = Enum.tuple(c)
655655
}
@@ -663,7 +663,7 @@ do {
663663
_ = Enum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
664664
_ = Enum.two(c) // expected-error {{missing argument for parameter #2 in call}}
665665

666-
_ = Enum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
666+
_ = Enum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
667667
_ = Enum.tuple((a, b))
668668
_ = Enum.tuple(c)
669669
}
@@ -1136,23 +1136,23 @@ do {
11361136
_ = GenericEnum.two(3, 4)
11371137
_ = GenericEnum.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
11381138

1139-
_ = GenericEnum.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1139+
_ = GenericEnum.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
11401140
_ = GenericEnum.tuple((3, 4))
11411141
}
11421142

11431143
do {
1144-
_ = GenericEnum<(Int, Int)>.one(3, 4) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1144+
_ = GenericEnum<(Int, Int)>.one(3, 4) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
11451145
_ = GenericEnum<(Int, Int)>.one((3, 4))
11461146

1147-
_ = GenericEnum<(Int, Int)>.labeled(x: 3, 4) // expected-error {{enum element 'labeled' expects a single parameter of type '(Int, Int)'}}
1147+
_ = GenericEnum<(Int, Int)>.labeled(x: 3, 4) // expected-error {{enum case 'labeled' expects a single parameter of type '(Int, Int)'}}
11481148
_ = GenericEnum<(Int, Int)>.labeled(x: (3, 4))
1149-
_ = GenericEnum<(Int, Int)>.labeled(3, 4) // expected-error {{enum element 'labeled' expects a single parameter of type '(Int, Int)'}}
1149+
_ = GenericEnum<(Int, Int)>.labeled(3, 4) // expected-error {{enum case 'labeled' expects a single parameter of type '(Int, Int)'}}
11501150
_ = GenericEnum<(Int, Int)>.labeled((3, 4)) // expected-error {{missing argument label 'x:' in call}}
11511151

11521152
_ = GenericEnum<Int>.two(3, 4)
11531153
_ = GenericEnum<Int>.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
11541154

1155-
_ = GenericEnum<Int>.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1155+
_ = GenericEnum<Int>.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
11561156
_ = GenericEnum<Int>.tuple((3, 4))
11571157
}
11581158

@@ -1169,7 +1169,7 @@ do {
11691169
_ = GenericEnum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
11701170
_ = GenericEnum.two(c) // expected-error {{missing argument for parameter #2 in call}}
11711171

1172-
_ = GenericEnum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1172+
_ = GenericEnum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
11731173
_ = GenericEnum.tuple((a, b))
11741174
_ = GenericEnum.tuple(c)
11751175
}
@@ -1179,15 +1179,15 @@ do {
11791179
let b = 4
11801180
let c = (a, b)
11811181

1182-
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1182+
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
11831183
_ = GenericEnum<(Int, Int)>.one((a, b))
11841184
_ = GenericEnum<(Int, Int)>.one(c)
11851185

11861186
_ = GenericEnum<Int>.two(a, b)
11871187
_ = GenericEnum<Int>.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
11881188
_ = GenericEnum<Int>.two(c) // expected-error {{missing argument for parameter #2 in call}}
11891189

1190-
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1190+
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
11911191
_ = GenericEnum<Int>.tuple((a, b))
11921192
_ = GenericEnum<Int>.tuple(c)
11931193
}
@@ -1205,7 +1205,7 @@ do {
12051205
_ = GenericEnum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
12061206
_ = GenericEnum.two(c) // expected-error {{missing argument for parameter #2 in call}}
12071207

1208-
_ = GenericEnum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1208+
_ = GenericEnum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
12091209
_ = GenericEnum.tuple((a, b))
12101210
_ = GenericEnum.tuple(c)
12111211
}
@@ -1215,15 +1215,15 @@ do {
12151215
var b = 4
12161216
var c = (a, b)
12171217

1218-
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1218+
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
12191219
_ = GenericEnum<(Int, Int)>.one((a, b))
12201220
_ = GenericEnum<(Int, Int)>.one(c)
12211221

12221222
_ = GenericEnum<Int>.two(a, b)
12231223
_ = GenericEnum<Int>.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
12241224
_ = GenericEnum<Int>.two(c) // expected-error {{missing argument for parameter #2 in call}}
12251225

1226-
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1226+
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
12271227
_ = GenericEnum<Int>.tuple((a, b))
12281228
_ = GenericEnum<Int>.tuple(c)
12291229
}

test/Constraints/members.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ struct GZ<T> {
5858
var i : T
5959
func getI() -> T { return i }
6060

61-
func f1<U>(_ a: T, b: U) -> (T, U) {
61+
func f1<U>(_ a: T, b: U) -> (T, U) {
6262
return (a, b)
6363
}
64-
64+
6565
func f2() {
6666
var f : Float
6767
var t = f1(i, b: f)
@@ -119,7 +119,7 @@ var wcurriedFull : () = w.curried(0)(1)
119119

120120
// Member of enum type
121121
func enumMetatypeMember(_ opt: Int?) {
122-
opt.none // expected-error{{enum element 'none' cannot be referenced as an instance member}}
122+
opt.none // expected-error{{enum case 'none' cannot be used as an instance member}}
123123
}
124124

125125
////
@@ -315,7 +315,7 @@ struct S22490787 {
315315

316316
func f22490787() {
317317
var path: S22490787 = S22490787()
318-
318+
319319
for p in path { // expected-error {{type 'S22490787' does not conform to protocol 'Sequence'}}
320320
}
321321
}
@@ -348,7 +348,7 @@ enum SR_2193_Error: Error {
348348

349349
do {
350350
throw SR_2193_Error.Boom
351-
} catch let e as SR_2193_Error.Boom { // expected-error {{enum element 'Boom' is not a member type of 'SR_2193_Error'}}
351+
} catch let e as SR_2193_Error.Boom { // expected-error {{enum case 'Boom' is not a member type of 'SR_2193_Error'}}
352352
}
353353

354354
// rdar://problem/25341015

test/Constraints/tuple_arguments.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,10 @@ do {
634634
_ = Enum.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
635635
_ = Enum.two(3 > 4 ? 3 : 4) // expected-error {{missing argument for parameter #2 in call}}
636636

637-
_ = Enum.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
637+
_ = Enum.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
638638
_ = Enum.tuple((3, 4))
639639

640-
_ = Enum.labeledTuple(x: 3, 4) // expected-error {{enum element 'labeledTuple' expects a single parameter of type '(Int, Int)'}}
640+
_ = Enum.labeledTuple(x: 3, 4) // expected-error {{enum case 'labeledTuple' expects a single parameter of type '(Int, Int)'}}
641641
_ = Enum.labeledTuple(x: (3, 4))
642642
}
643643

@@ -650,7 +650,7 @@ do {
650650
_ = Enum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
651651
_ = Enum.two(c) // expected-error {{missing argument for parameter #2 in call}}
652652

653-
_ = Enum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
653+
_ = Enum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
654654
_ = Enum.tuple((a, b))
655655
_ = Enum.tuple(c)
656656
}
@@ -664,7 +664,7 @@ do {
664664
_ = Enum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
665665
_ = Enum.two(c) // expected-error {{missing argument for parameter #2 in call}}
666666

667-
_ = Enum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
667+
_ = Enum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{18-18=(}} {{22-22=)}}
668668
_ = Enum.tuple((a, b))
669669
_ = Enum.tuple(c)
670670
}
@@ -1137,23 +1137,23 @@ do {
11371137
_ = GenericEnum.two(3, 4)
11381138
_ = GenericEnum.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
11391139

1140-
_ = GenericEnum.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1140+
_ = GenericEnum.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
11411141
_ = GenericEnum.tuple((3, 4))
11421142
}
11431143

11441144
do {
1145-
_ = GenericEnum<(Int, Int)>.one(3, 4) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1145+
_ = GenericEnum<(Int, Int)>.one(3, 4) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
11461146
_ = GenericEnum<(Int, Int)>.one((3, 4))
11471147

1148-
_ = GenericEnum<(Int, Int)>.labeled(x: 3, 4) // expected-error {{enum element 'labeled' expects a single parameter of type '(Int, Int)'}}
1148+
_ = GenericEnum<(Int, Int)>.labeled(x: 3, 4) // expected-error {{enum case 'labeled' expects a single parameter of type '(Int, Int)'}}
11491149
_ = GenericEnum<(Int, Int)>.labeled(x: (3, 4))
1150-
_ = GenericEnum<(Int, Int)>.labeled(3, 4) // expected-error {{enum element 'labeled' expects a single parameter of type '(Int, Int)'}}
1150+
_ = GenericEnum<(Int, Int)>.labeled(3, 4) // expected-error {{enum case 'labeled' expects a single parameter of type '(Int, Int)'}}
11511151
_ = GenericEnum<(Int, Int)>.labeled((3, 4)) // expected-error {{missing argument label 'x:' in call}}
11521152

11531153
_ = GenericEnum<Int>.two(3, 4)
11541154
_ = GenericEnum<Int>.two((3, 4)) // expected-error {{missing argument for parameter #2 in call}}
11551155

1156-
_ = GenericEnum<Int>.tuple(3, 4) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1156+
_ = GenericEnum<Int>.tuple(3, 4) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
11571157
_ = GenericEnum<Int>.tuple((3, 4))
11581158
}
11591159

@@ -1170,7 +1170,7 @@ do {
11701170
_ = GenericEnum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
11711171
_ = GenericEnum.two(c) // expected-error {{missing argument for parameter #2 in call}}
11721172

1173-
_ = GenericEnum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1173+
_ = GenericEnum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
11741174
_ = GenericEnum.tuple((a, b))
11751175
_ = GenericEnum.tuple(c)
11761176
}
@@ -1180,15 +1180,15 @@ do {
11801180
let b = 4
11811181
let c = (a, b)
11821182

1183-
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1183+
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
11841184
_ = GenericEnum<(Int, Int)>.one((a, b))
11851185
_ = GenericEnum<(Int, Int)>.one(c)
11861186

11871187
_ = GenericEnum<Int>.two(a, b)
11881188
_ = GenericEnum<Int>.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
11891189
_ = GenericEnum<Int>.two(c) // expected-error {{missing argument for parameter #2 in call}}
11901190

1191-
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1191+
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
11921192
_ = GenericEnum<Int>.tuple((a, b))
11931193
_ = GenericEnum<Int>.tuple(c)
11941194
}
@@ -1206,7 +1206,7 @@ do {
12061206
_ = GenericEnum.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
12071207
_ = GenericEnum.two(c) // expected-error {{missing argument for parameter #2 in call}}
12081208

1209-
_ = GenericEnum.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
1209+
_ = GenericEnum.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(T, T)'}} {{25-25=(}} {{29-29=)}}
12101210
_ = GenericEnum.tuple((a, b))
12111211
_ = GenericEnum.tuple(c)
12121212
}
@@ -1216,15 +1216,15 @@ do {
12161216
var b = 4
12171217
var c = (a, b)
12181218

1219-
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum element 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
1219+
_ = GenericEnum<(Int, Int)>.one(a, b) // expected-error {{enum case 'one' expects a single parameter of type '(Int, Int)'}} {{35-35=(}} {{39-39=)}}
12201220
_ = GenericEnum<(Int, Int)>.one((a, b))
12211221
_ = GenericEnum<(Int, Int)>.one(c)
12221222

12231223
_ = GenericEnum<Int>.two(a, b)
12241224
_ = GenericEnum<Int>.two((a, b)) // expected-error {{missing argument for parameter #2 in call}}
12251225
_ = GenericEnum<Int>.two(c) // expected-error {{missing argument for parameter #2 in call}}
12261226

1227-
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum element 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
1227+
_ = GenericEnum<Int>.tuple(a, b) // expected-error {{enum case 'tuple' expects a single parameter of type '(Int, Int)'}} {{30-30=(}} {{34-34=)}}
12281228
_ = GenericEnum<Int>.tuple((a, b))
12291229
_ = GenericEnum<Int>.tuple(c)
12301230
}

test/Generics/generic_types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,5 @@ struct UnsolvableInheritance2<T : U.A, U : T.A> {}
240240
// expected-error@-1 {{inheritance from non-protocol, non-class type 'U.A'}}
241241
// expected-error@-2 {{inheritance from non-protocol, non-class type 'T.A'}}
242242

243-
enum X7<T> where X7.X : G { case X } // expected-error{{enum element 'X' is not a member type of 'X7<T>'}}
243+
enum X7<T> where X7.X : G { case X } // expected-error{{enum case 'X' is not a member type of 'X7<T>'}}
244244
// expected-error@-1{{use of undeclared type 'G'}}

test/Parse/enum.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ enum SE0036 {
468468
}
469469

470470
func staticReferenceInInstanceMethod() {
471-
_ = A // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{9-9=SE0036.}}
472-
_ = self.A // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{none}}
471+
_ = A // expected-error {{enum case 'A' cannot be used as an instance member}} {{9-9=SE0036.}}
472+
_ = self.A // expected-error {{enum case 'A' cannot be used as an instance member}} {{none}}
473473
_ = SE0036.A
474474
}
475475

@@ -483,9 +483,9 @@ enum SE0036 {
483483

484484
func staticReferenceInSwitchInInstanceMethod() {
485485
switch self {
486-
case A: break // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{10-10=.}}
487-
case B(_): break // expected-error {{enum element 'B' cannot be referenced as an instance member}} {{10-10=.}}
488-
case C(let x): _ = x; break // expected-error {{enum element 'C' cannot be referenced as an instance member}} {{10-10=.}}
486+
case A: break // expected-error {{enum case 'A' cannot be used as an instance member}} {{10-10=.}}
487+
case B(_): break // expected-error {{enum case 'B' cannot be used as an instance member}} {{10-10=.}}
488+
case C(let x): _ = x; break // expected-error {{enum case 'C' cannot be used as an instance member}} {{10-10=.}}
489489
}
490490
}
491491

@@ -515,10 +515,10 @@ enum SE0036 {
515515

516516
init() {
517517
self = .A
518-
self = A // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{12-12=.}}
518+
self = A // expected-error {{enum case 'A' cannot be used as an instance member}} {{12-12=.}}
519519
self = SE0036.A
520520
self = .B(SE0036_Auxiliary())
521-
self = B(SE0036_Auxiliary()) // expected-error {{enum element 'B' cannot be referenced as an instance member}} {{12-12=.}}
521+
self = B(SE0036_Auxiliary()) // expected-error {{enum case 'B' cannot be used as an instance member}} {{12-12=.}}
522522
self = SE0036.B(SE0036_Auxiliary())
523523
}
524524
}
@@ -528,7 +528,7 @@ enum SE0036_Generic<T> {
528528

529529
func foo() {
530530
switch self {
531-
case A(_): break // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{10-10=.}}
531+
case A(_): break // expected-error {{enum case 'A' cannot be used as an instance member}} {{10-10=.}}
532532
}
533533

534534
switch self {

test/attr/attr_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ enum BadEnum1: Int { case X }
17991799

18001800
@objc
18011801
enum BadEnum2: Int {
1802-
@objc(X:) // expected-error{{'@objc' enum element must have a simple name}}{{10-11=}}
1802+
@objc(X:) // expected-error{{'@objc' enum case must have a simple name}}{{10-11=}}
18031803
case X
18041804
}
18051805

validation-test/Sema/type_checker_crashers_fixed/rdar27261929.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct P<I, O> {
1919
public func test() -> P<I, [O]> {
2020
return P<I, [O]> { input in
2121
var output: [O] = []
22-
_ = R<([O], I)>.value(output, input) // expected-error {{enum element 'value' expects a single parameter of type '([O], I)'}}
22+
_ = R<([O], I)>.value(output, input) // expected-error {{enum case 'value' expects a single parameter of type '([O], I)'}}
2323
return R<([O], I)>.value((output, input))
2424
}
2525
}

0 commit comments

Comments
 (0)