@@ -30,8 +30,8 @@ case var a:
3030 a = 1
3131case let a:
3232 a = 1 // expected-error {{cannot assign}}
33- case inout a:
34- a = 1
33+ case inout a: // expected-error {{'inout' may only be used on parameters}} expected-error {{'is' keyword required to pattern match against type name}}
34+ a = 1 // expected-error {{cannot find 'a' in scope}}
3535case var var a: // expected-error {{'var' cannot appear nested inside another 'var' or 'let' pattern}}
3636 a += 1
3737case var let a: // expected-error {{'let' cannot appear nested inside another 'var' or 'let' pattern}}
@@ -54,14 +54,6 @@ case _: // expected-warning {{case is already handled by previous patterns; cons
5454 ( )
5555}
5656
57- switch ( x, x) {
58- case ( inout a, inout a) : // expected-error {{invalid redeclaration of 'a'}}
59- // expected-note @-1 {{'a' previously declared here}}
60- // xpected-warning @-2 {{variable 'a' was never used; consider replacing with '_' or removing it}}
61- // xpected-warning @-3 {{variable 'a' was never used; consider replacing with '_' or removing it}}
62- break
63- }
64-
6557var e : Any = 0
6658
6759switch e { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
@@ -128,12 +120,6 @@ if case let .Naught(value) = n {} // expected-error{{pattern with associated val
128120if case let . Naught( value1, value2, value3) = n { } // expected-error{{pattern with associated values does not match enum case 'Naught'}}
129121 // expected-note@-1 {{remove associated values to make the pattern match}} {{20-44=}}
130122
131- if case inout . Naught( value) = n { } // expected-error{{pattern with associated values does not match enum case 'Naught'}}
132- // expected-note@-1 {{remove associated values to make the pattern match}} {{22-29=}}
133- if case inout . Naught( value1, value2, value3) = n { } // expected-error{{pattern with associated values does not match enum case 'Naught'}}
134- // expected-note@-1 {{remove associated values to make the pattern match}} {{22-46=}}
135-
136-
137123
138124switch n {
139125case Foo . A: // expected-error{{enum case 'A' is not a member of type 'Voluntary<Int>'}}
@@ -156,7 +142,7 @@ case Voluntary<Int>.Mere,
156142 ( )
157143case . Twain,
158144 . Twain( _) , // expected-warning {{enum case 'Twain' has 2 associated values; matching them as a tuple is deprecated}}
159- // expected-note@-74 {{'Twain' declared here}}
145+ // expected-note@-68 {{'Twain' declared here}}
160146 . Twain( _, _) ,
161147 . Twain( _, _, _) : // expected-error{{tuple pattern has the wrong length for tuple type '(Int, Int)'}}
162148 ( )
@@ -299,9 +285,6 @@ case (_, var e, 3) +++ (1, 2, 3):
299285// expected-error@-1{{'_' can only appear in a pattern or on the left side of an assignment}}
300286 ( )
301287case ( let ( _, _, _) ) + 1 :
302- // expected-error@-1 {{'_' can only appear in a pattern or on the left side of an assignment}}
303- ( )
304- case ( inout ( _, _, 2 ) ) + 1 :
305288// expected-error@-1 {{'_' can only appear in a pattern or on the left side of an assignment}}
306289 ( )
307290}
0 commit comments