We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29e229b commit 64709f8Copy full SHA for 64709f8
tests/pos/i10369.scala
@@ -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
14
15
0 commit comments