Skip to content

Commit fadd4b7

Browse files
committed
Test pattern matching of tuples >= 23.
1 parent 4ad41d4 commit fadd4b7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/run/tuples1.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ c2_1 = (A,1,1)
3232
c2_2 = (A,1,A,1)
3333
c2_3 = (A,1,2,A,1)
3434
c3_3 = (2,A,1,2,A,1)
35+
276
3536
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)

tests/run/tuples1.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ object Test extends App {
4141
Int, Int, Int, Int, Int,
4242
Int, Int, Int)
4343
val x23c: T23 = x23
44+
x23 match {
45+
case (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23) =>
46+
println(x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23)
47+
}
4448
println(x23)
4549
assert(x23(0) == 1)
4650
assert(x23(22) == 23)

0 commit comments

Comments
 (0)