Skip to content

Commit c2e1562

Browse files
authored
Merge pull request #9128 from dotty-staging/fix-#8956
fix #8956: add regression test
2 parents f26ff0f + 7309b35 commit c2e1562

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type Numeric = Double | Int
2+
3+
val v1 = 100
4+
val v2 = 100.0
5+
def check1(i: Double | Int | String): Unit = {
6+
i match {
7+
case a:(Double | Int) => println(s"numeric = $a")
8+
case _ => println("categorical")
9+
}
10+
}
11+
def check2(i: Double | Int | String): Unit = {
12+
i match {
13+
case a:Numeric => println(s"numeric = $a")
14+
case _ => println("categorical")
15+
}
16+
}

0 commit comments

Comments
 (0)