Skip to content

Commit 2d4d9eb

Browse files
committed
update test.
1 parent 0b172f5 commit 2d4d9eb

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

test/Parse/matching_patterns.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ case _: // expected-warning {{case is already handled by previous patterns; cons
5858

5959
var e : Any = 0
6060

61-
switch e { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
61+
switch e { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
6262
// 'is' pattern.
6363
case is Int,
6464
is A<Int>,
@@ -152,7 +152,7 @@ struct ContainsEnum {
152152
}
153153

154154
func member(_ n: Possible<Int>) {
155-
switch n { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
155+
switch n { // expected-error {{switch must be exhaustive}}
156156
// expected-note@-1 {{missing case: '.Mere(_)'}}
157157
// expected-note@-2 {{missing case: '.Twain(_, _)'}}
158158
case ContainsEnum.Possible<Int>.Naught,
@@ -166,7 +166,7 @@ struct ContainsEnum {
166166
}
167167

168168
func nonmemberAccessesMemberType(_ n: ContainsEnum.Possible<Int>) {
169-
switch n { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
169+
switch n { // expected-error {{switch must be exhaustive}}
170170
// expected-note@-1 {{missing case: '.Mere(_)'}}
171171
// expected-note@-2 {{missing case: '.Twain(_, _)'}}
172172
case ContainsEnum.Possible<Int>.Naught,

test/Parse/switch.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ default:
7171
}
7272

7373
// Multiple cases per case block
74-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
74+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
7575
case 0: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
7676
case 1:
7777
x = 0
@@ -83,7 +83,7 @@ default:
8383
x = 0
8484
}
8585

86-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
86+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
8787
case 0:
8888
x = 0
8989
case 1: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
@@ -95,7 +95,7 @@ case 0:
9595
default: // expected-error {{'default' label in a 'switch' should have at least one executable statement}} {{9-9= break}}
9696
}
9797

98-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
98+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
9999
case 0:
100100
; // expected-error {{';' statements are not allowed}} {{3-5=}}
101101
case 1:
@@ -142,22 +142,22 @@ default: // expected-error{{additional 'case' blocks cannot appear after the 'de
142142
x = 0
143143
}
144144

145-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
145+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
146146
default where x == 0: // expected-error{{'default' cannot be used with a 'where' guard expression}}
147147
x = 0
148148
}
149149

150-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
150+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
151151
case 0: // expected-error {{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
152152
}
153153

154-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
154+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
155155
case 0: // expected-error{{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
156156
case 1:
157157
x = 0
158158
}
159159

160-
switch x { // expected-error {{switch must be exhaustive, consider adding a default clause:}}
160+
switch x { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
161161
case 0:
162162
x = 0
163163
case 1: // expected-error{{'case' label in a 'switch' should have at least one executable statement}} {{8-8= break}}
@@ -260,7 +260,7 @@ case (var a, var b): // expected-warning {{variable 'a' was never mutated; consi
260260
}
261261

262262
func test_label(x : Int) {
263-
Gronk: // expected-error {{switch must be exhaustive, consider adding a default clause:}}
263+
Gronk: // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
264264
switch x {
265265
case 42: return
266266
}

test/Parse/switch_incomplete.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
// <rdar://problem/15971438> Incomplete switch was parsing to an AST that
44
// triggered an assertion failure.
5-
// expected-error@+1 {{switch must be exhaustive, consider adding a default clause:}}
5+
// expected-error@+1 {{switch must be exhaustive}} expected-note@+1{{do you want to add a default clause?}}
66
switch 1 { // expected-note{{to match this opening '{'}}
77
case 1: // expected-error@+1{{expected '}' at end of 'switch' statement}}

test/Sema/exhaustive_switch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ enum Threepeat {
7979
}
8080

8181
func test3(x: Threepeat, y: Threepeat) {
82-
switch (x, y) { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
83-
// expected-note@-1 {{missing case: '(.a, .c)'}}
82+
switch (x, y) { // expected-error {{switch must be exhaustive}}
83+
// expected-note@-1 {{add missing case: '(.a, .c)'}}
8484
case (.a, .a):
8585
()
8686
case (.b, _):

0 commit comments

Comments
 (0)