summaryrefslogtreecommitdiff
path: root/test/files/neg/t8731.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/t8731.scala')
-rw-r--r--test/files/neg/t8731.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/t8731.scala b/test/files/neg/t8731.scala
new file mode 100644
index 0000000000..d93fe706ad
--- /dev/null
+++ b/test/files/neg/t8731.scala
@@ -0,0 +1,15 @@
+class C {
+ // not a compile-time constant due to return type
+ final val K: Int = 20
+
+ def f(x: Int) = (x: @annotation.switch) match {
+ case K => 0
+ case 2 => 1
+ }
+
+ def g(x: Int) = (x: @annotation.switch) match {
+ case K => 0
+ case 2 => 1
+ case 3 => 2
+ }
+}