Skip to content

Commit eca1c1f

Browse files
committed
[Test] Adds a new test case
1 parent a332eb6 commit eca1c1f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/Constraints/tuple.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,8 @@ func dupLabel2(x a: Int, x b: Int) -> (y: Int, y: Int) { // expected-error {{can
299299
}
300300

301301
let _ = (bar: 0, bar: "") // expected-error {{cannot create a tuple with a duplicate element label}}
302+
303+
let zeroTuple = (0,0)
304+
305+
if case (foo: let x, foo: let y) = zeroTuple { print(x+y) } // expected-error {{cannot create a tuple with a duplicate element label}}
306+
// expected-warning@-1 {{'if' condition is always true}}

0 commit comments

Comments
 (0)