Skip to content

Commit 6a86f99

Browse files
committed
Change test to use non-toplevel rewrite match
1 parent 8305ba7 commit 6a86f99

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/run/TupleAbstract.scala

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,26 @@ object Tuples {
138138

139139
rewrite def head: Any = {
140140
erased val resTpe = Typed(_head(xs))
141-
rewrite _size(xs) match {
141+
val resVal = rewrite _size(xs) match {
142142
case 1 =>
143143
val t = xs.asInstanceOf[Tuple1[_]]
144-
t._1.asInstanceOf[resTpe.Type]
144+
t._1
145145
case 2 =>
146146
val t = xs.asInstanceOf[Tuple2[_, _]]
147-
t._1.asInstanceOf[resTpe.Type]
147+
t._1
148148
case 3 =>
149149
val t = xs.asInstanceOf[Tuple3[_, _, _]]
150-
t._1.asInstanceOf[resTpe.Type]
150+
t._1
151151
case 4 =>
152152
val t = xs.asInstanceOf[Tuple4[_, _, _, _]]
153-
t._1.asInstanceOf[resTpe.Type]
153+
t._1
154154
case n if n > 4 && n <= MaxSpecialized =>
155-
xs.asInstanceOf[Product].productElement(0).asInstanceOf[resTpe.Type]
155+
xs.asInstanceOf[Product].productElement(0)
156156
case n if n > MaxSpecialized =>
157157
val t = xs.asInstanceOf[TupleXXL]
158-
t.elems(0).asInstanceOf[resTpe.Type]
158+
t.elems(0)
159159
}
160+
resVal.asInstanceOf[resTpe.Type]
160161
}
161162

162163
rewrite def tail: Any = {

0 commit comments

Comments
 (0)