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
Copy file name to clipboardExpand all lines: test/Parse/switch.swift
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -72,27 +72,27 @@ default:
72
72
73
73
// Multiple cases per case block
74
74
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
75
-
case0: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
75
+
case0: // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
76
76
case 1:
77
77
x =0
78
78
}
79
79
80
80
switch x {
81
-
case0: // expected-error{{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
81
+
case0: // expected-error{{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
82
82
default:
83
83
x =0
84
84
}
85
85
86
86
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
87
87
case0:
88
88
x =0
89
-
case1: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
89
+
case1: // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
90
90
}
91
91
92
92
switch x {
93
93
case0:
94
94
x =0
95
-
default: // expected-error {{'default' label in a 'switch' should have at least one executable statement}} {{9-9= break}}
95
+
default: // expected-error {{'default' label in a 'switch' must have at least one executable statement}} {{9-9= break}}
96
96
}
97
97
98
98
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
@@ -131,13 +131,13 @@ switch x { // expected-error{{'switch' statement body must have at least one 'ca
131
131
}
132
132
133
133
switch x {
134
-
default: // expected-error{{'default' label in a 'switch' should have at least one executable statement}} {{9-9= break}}
134
+
default: // expected-error{{'default' label in a 'switch' must have at least one executable statement}} {{9-9= break}}
135
135
case 0: // expected-error{{additional 'case' blocks cannot appear after the 'default' block of a 'switch'}}
136
136
x =0
137
137
}
138
138
139
139
switch x {
140
-
default: // expected-error{{'default' label in a 'switch' should have at least one executable statement}} {{9-9= break}}
140
+
default: // expected-error{{'default' label in a 'switch' must have at least one executable statement}} {{9-9= break}}
141
141
default: // expected-error{{additional 'case' blocks cannot appear after the 'default' block of a 'switch'}}
142
142
x =0
143
143
}
@@ -148,19 +148,19 @@ default where x == 0: // expected-error{{'default' cannot be used with a 'where'
148
148
}
149
149
150
150
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
151
-
case0: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
151
+
case0: // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
152
152
}
153
153
154
154
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
155
-
case0: // expected-error{{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
155
+
case0: // expected-error{{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
156
156
case 1:
157
157
x =0
158
158
}
159
159
160
160
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
161
161
case0:
162
162
x =0
163
-
case1: // expected-error{{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
163
+
case1: // expected-error{{'case' label in a 'switch' must have at least one executable statement}} {{8-8= break}}
164
164
}
165
165
166
166
@@ -206,15 +206,15 @@ case (_, 2), (var a, _): // expected-error {{'a' must be bound in every pattern}
206
206
case(var a,2),(1,var b): // expected-error {{'a' must be bound in every pattern}} expected-error {{'b' must be bound in every pattern}} expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
207
207
()
208
208
209
-
case(var a,2): // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{17-17= break}} expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
209
+
case(var a,2): // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{17-17= break}} expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
210
210
case(1, _):
211
211
()
212
212
213
-
case(_,2): // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{13-13= break}}
213
+
case(_,2): // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{13-13= break}}
214
214
case(1, var a): // expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
215
215
()
216
216
217
-
case(var a,2): // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{17-17= break}} expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
217
+
case(var a,2): // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{17-17= break}} expected-warning {{variable 'a' was never used; consider replacing with '_' or removing it}}
218
218
case(1, var b): // expected-warning {{variable 'b' was never used; consider replacing with '_' or removing it}}
219
219
()
220
220
@@ -238,7 +238,7 @@ case (var a, var b), (var b, var a): // expected-warning {{variable 'a' was neve
238
238
// expected-warning@-2 {{case is already handled by previous patterns; consider removing it}}
239
239
()
240
240
241
-
case(_,2): // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{13-13= break}}
241
+
case(_,2): // expected-error {{'case' label in a 'switch' must have at least one executable statement}} {{13-13= break}}
0 commit comments