Skip to content

Commit 5b48d46

Browse files
Address review
1 parent 5687782 commit 5b48d46

File tree

2 files changed

+127
-126
lines changed

2 files changed

+127
-126
lines changed

tests/tuples/tuple-accessors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ object Test {
120120
v22: Int
121121

122122
// We can't go above that since patDef is implemented with direct _i calls.
123-
// It's should be possible to update the desugaring to use var + pattern
123+
// It should be possible to update the desugaring to use var + pattern
124124
// matching instead, which would lift this (the last?) 22 limitation.
125125

126126
// val x23 = X23(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)

tests/tuples/tuple-cons.scala

Lines changed: 126 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@ import dotty._
22

33
object Test {
44
def main(args: Array[String]) = {
5-
// val t1 = (1, 2)
5+
val t1 = (1, 2)
66

7-
// val t2: TupleCons[Int, TupleCons[Int, TupleCons[Int, Unit]]] = TupleCons(0, t1)
7+
val t2: TupleCons[Int, TupleCons[Int, TupleCons[Int, Unit]]] = TupleCons(0, t1)
88

9-
// assert(t2._1 == 0)
10-
// assert(t2._2 == 1)
11-
// assert(t2._3 == 2)
9+
assert(t2._1 == 0)
10+
assert(t2._2 == 1)
11+
assert(t2._3 == 2)
1212

13-
// t2 match {
14-
// case TupleCons(e1, TupleCons(e2, TupleCons(e3, ()))) =>
15-
// assert(e1 == 0)
16-
// assert(e2 == 1)
17-
// assert(e3 == 2)
18-
// }
13+
t2 match {
14+
case TupleCons(e1, TupleCons(e2, TupleCons(e3, ()))) =>
15+
assert(e1 == 0)
16+
assert(e2 == 1)
17+
assert(e3 == 2)
18+
}
1919

20-
// val t3: TupleCons[Int, TupleCons[Int, TupleCons[Int, TupleCons[Int, Unit]]]] = TupleCons(-1, t2)
20+
val t3: TupleCons[Int, TupleCons[Int, TupleCons[Int, TupleCons[Int, Unit]]]] = TupleCons(-1, t2)
2121

22-
// assert(t3._1 == -1)
23-
// assert(t3._2 == 0)
24-
// assert(t3._3 == 1)
25-
// assert(t3._4 == 2)
22+
assert(t3._1 == -1)
23+
assert(t3._2 == 0)
24+
assert(t3._3 == 1)
25+
assert(t3._4 == 2)
2626

27-
// t3 match {
28-
// case TupleCons(e1, TupleCons(e2, TupleCons(e3, TupleCons(e4, ())))) =>
29-
// assert(e1 == -1)
30-
// assert(e2 == 0)
31-
// assert(e3 == 1)
32-
// assert(e4 == 2)
33-
// }
27+
t3 match {
28+
case TupleCons(e1, TupleCons(e2, TupleCons(e3, TupleCons(e4, ())))) =>
29+
assert(e1 == -1)
30+
assert(e2 == 0)
31+
assert(e3 == 1)
32+
assert(e4 == 2)
33+
}
3434

3535
val C = TupleCons
3636
type C[A, B <: Tuple] = TupleCons[A, B]
@@ -39,86 +39,87 @@ object Test {
3939
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
4040
val t20: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]] = C(1,C(2,C(3,C(4,C(5,C(6,C(7,C(8,C(9,C(10,C(11,C(12,C(13,C(14,C(15,C(16,C(17,C(18,C(19,C(20,()))))))))))))))))))))
4141

42-
// t20 match {
43-
// case C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))) =>
44-
// assert(e1 == 1)
45-
// assert(e2 == 2)
46-
// assert(e3 == 3)
47-
// assert(e4 == 4)
48-
// assert(e5 == 5)
49-
// assert(e6 == 6)
50-
// assert(e7 == 7)
51-
// assert(e8 == 8)
52-
// assert(e9 == 9)
53-
// assert(e10 == 10)
54-
// assert(e11 == 11)
55-
// assert(e12 == 12)
56-
// assert(e13 == 13)
57-
// assert(e14 == 14)
58-
// assert(e15 == 15)
59-
// assert(e16 == 16)
60-
// assert(e17 == 17)
61-
// assert(e18 == 18)
62-
// assert(e19 == 19)
63-
// assert(e20 == 20)
64-
// }
42+
t20 match {
43+
case C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))) =>
44+
assert(e1 == 1)
45+
assert(e2 == 2)
46+
assert(e3 == 3)
47+
assert(e4 == 4)
48+
assert(e5 == 5)
49+
assert(e6 == 6)
50+
assert(e7 == 7)
51+
assert(e8 == 8)
52+
assert(e9 == 9)
53+
assert(e10 == 10)
54+
assert(e11 == 11)
55+
assert(e12 == 12)
56+
assert(e13 == 13)
57+
assert(e14 == 14)
58+
assert(e15 == 15)
59+
assert(e16 == 16)
60+
assert(e17 == 17)
61+
assert(e18 == 18)
62+
assert(e19 == 19)
63+
assert(e20 == 20)
64+
}
6565

6666
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
6767
val t21: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]]] = C(21, t20)
6868

69-
// t21 match {
70-
// case C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ()))))))))))))))))))))) =>
71-
// assert(e1 == 1)
72-
// assert(e2 == 2)
73-
// assert(e3 == 3)
74-
// assert(e4 == 4)
75-
// assert(e5 == 5)
76-
// assert(e6 == 6)
77-
// assert(e7 == 7)
78-
// assert(e8 == 8)
79-
// assert(e9 == 9)
80-
// assert(e10 == 10)
81-
// assert(e11 == 11)
82-
// assert(e12 == 12)
83-
// assert(e13 == 13)
84-
// assert(e14 == 14)
85-
// assert(e15 == 15)
86-
// assert(e16 == 16)
87-
// assert(e17 == 17)
88-
// assert(e18 == 18)
89-
// assert(e19 == 19)
90-
// assert(e20 == 20)
91-
// assert(e21 == 21)
92-
// }
69+
t21 match {
70+
case C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ()))))))))))))))))))))) =>
71+
assert(e1 == 1)
72+
assert(e2 == 2)
73+
assert(e3 == 3)
74+
assert(e4 == 4)
75+
assert(e5 == 5)
76+
assert(e6 == 6)
77+
assert(e7 == 7)
78+
assert(e8 == 8)
79+
assert(e9 == 9)
80+
assert(e10 == 10)
81+
assert(e11 == 11)
82+
assert(e12 == 12)
83+
assert(e13 == 13)
84+
assert(e14 == 14)
85+
assert(e15 == 15)
86+
assert(e16 == 16)
87+
assert(e17 == 17)
88+
assert(e18 == 18)
89+
assert(e19 == 19)
90+
assert(e20 == 20)
91+
assert(e21 == 21)
92+
}
9393

9494
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
9595
val t22: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]]]] = C(22, t21)
9696

97-
// t22 match {
98-
// case C(e22, C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))))) =>
99-
// assert(e1 == 1)
100-
// assert(e2 == 2)
101-
// assert(e3 == 3)
102-
// assert(e4 == 4)
103-
// assert(e5 == 5)
104-
// assert(e6 == 6)
105-
// assert(e7 == 7)
106-
// assert(e8 == 8)
107-
// assert(e9 == 9)
108-
// assert(e10 == 10)
109-
// assert(e11 == 11)
110-
// assert(e12 == 12)
111-
// assert(e13 == 13)
112-
// assert(e14 == 14)
113-
// assert(e15 == 15)
114-
// assert(e16 == 16)
115-
// assert(e17 == 17)
116-
// assert(e18 == 18)
117-
// assert(e19 == 19)
118-
// assert(e20 == 20)
119-
// assert(e21 == 21)
120-
// assert(e22 == 22)
121-
// }
97+
t22 match {
98+
case C(e22, C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))))) =>
99+
assert(e1 == 1)
100+
assert(e2 == 2)
101+
assert(e3 == 3)
102+
assert(e4 == 4)
103+
assert(e5 == 5)
104+
assert(e6 == 6)
105+
assert(e7 == 7)
106+
assert(e8 == 8)
107+
assert(e9 == 9)
108+
assert(e10 == 10)
109+
assert(e11 == 11)
110+
assert(e12 == 12)
111+
assert(e13 == 13)
112+
assert(e14 == 14)
113+
assert(e15 == 15)
114+
assert(e16 == 16)
115+
assert(e17 == 17)
116+
assert(e18 == 18)
117+
assert(e19 == 19)
118+
assert(e20 == 20)
119+
assert(e21 == 21)
120+
assert(e22 == 22)
121+
}
122+
122123
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
123124
val t23: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]]]]] = C(23, t22)
124125

@@ -149,35 +150,35 @@ object Test {
149150
assert(e23 == 23)
150151
}
151152

152-
// // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
153-
// val t24: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]]]]]] = C(24, t23)
154-
155-
// t24 match {
156-
// case C(e24, C(e23, C(e22, C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))))))) =>
157-
// assert(e1 == 1)
158-
// assert(e2 == 2)
159-
// assert(e3 == 3)
160-
// assert(e4 == 4)
161-
// assert(e5 == 5)
162-
// assert(e6 == 6)
163-
// assert(e7 == 7)
164-
// assert(e8 == 8)
165-
// assert(e9 == 9)
166-
// assert(e10 == 10)
167-
// assert(e11 == 11)
168-
// assert(e12 == 12)
169-
// assert(e13 == 13)
170-
// assert(e14 == 14)
171-
// assert(e15 == 15)
172-
// assert(e16 == 16)
173-
// assert(e17 == 17)
174-
// assert(e18 == 18)
175-
// assert(e19 == 19)
176-
// assert(e20 == 20)
177-
// assert(e21 == 21)
178-
// assert(e22 == 22)
179-
// assert(e23 == 23)
180-
// assert(e24 == 24)
181-
// }
153+
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
154+
val t24: C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,C[I,Unit]]]]]]]]]]]]]]]]]]]]]]]] = C(24, t23)
155+
156+
t24 match {
157+
case C(e24, C(e23, C(e22, C(e21, C(e1, C(e2, C(e3, C(e4, C(e5, C(e6, C(e7, C(e8, C(e9, C(e10, C(e11, C(e12, C(e13, C(e14, C(e15, C(e16, C(e17, C(e18, C(e19, C(e20, ())))))))))))))))))))))))) =>
158+
assert(e1 == 1)
159+
assert(e2 == 2)
160+
assert(e3 == 3)
161+
assert(e4 == 4)
162+
assert(e5 == 5)
163+
assert(e6 == 6)
164+
assert(e7 == 7)
165+
assert(e8 == 8)
166+
assert(e9 == 9)
167+
assert(e10 == 10)
168+
assert(e11 == 11)
169+
assert(e12 == 12)
170+
assert(e13 == 13)
171+
assert(e14 == 14)
172+
assert(e15 == 15)
173+
assert(e16 == 16)
174+
assert(e17 == 17)
175+
assert(e18 == 18)
176+
assert(e19 == 19)
177+
assert(e20 == 20)
178+
assert(e21 == 21)
179+
assert(e22 == 22)
180+
assert(e23 == 23)
181+
assert(e24 == 24)
182+
}
182183
}
183184
}

0 commit comments

Comments
 (0)