Skip to content

Commit 7262437

Browse files
authored
Add a regression test (#17102)
2 parents 59c43ad + 64709f8 commit 7262437

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/pos/i10369.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type Upgrade[T] = T match
2+
case Int => Double
3+
case Char => String
4+
case Boolean => Boolean
5+
6+
val upgrade: [t] => t => Upgrade[t] = new PolyFunction:
7+
def apply[T](x: T): Upgrade[T] = x match
8+
case x: Int => x.toDouble
9+
case x: Char => x.toString
10+
case x: Boolean => !x
11+
12+
val upgrade2: [t] => t => Upgrade[t] = [t] => (x: t) => x match
13+
case x: Int => x.toDouble
14+
case x: Char => x.toString
15+
case x: Boolean => !x

0 commit comments

Comments
 (0)