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 345c8bc commit 4eaab9bCopy full SHA for 4eaab9b
tests/pos/i8956.scala
@@ -0,0 +1,22 @@
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
+/*
12
+ [warn] 25 | case a:Numeric => println(s"numeric = $a")
13
+ [warn] | ^^^^^^^^^
14
+ [warn] | the type test for gg.SlidingIssue.Numeric cannot be checked at runtime
15
+ [warn] one warning found
16
+ */
17
+def check2(i: Double | Int | String): Unit = {
18
19
+ case a:Numeric => println(s"numeric = $a")
20
21
22
0 commit comments