aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t6595.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/t6595.scala')
-rw-r--r--tests/untried/pos/t6595.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/untried/pos/t6595.scala b/tests/untried/pos/t6595.scala
new file mode 100644
index 000000000..437c0bcf0
--- /dev/null
+++ b/tests/untried/pos/t6595.scala
@@ -0,0 +1,18 @@
+import scala.annotation.switch
+
+class Foo extends {
+ final val b0 = 5
+} with AnyRef {
+ final val b1 = 10
+
+ // Using the @switch annotation as a means of testing that the
+ // type inferred for b0 is Int(5) and not Int. Only in the former
+ // case can a switch be generated.
+ def f(p: Int) = (p: @switch) match {
+ case `b0` => 1
+ case `b1` => 2
+ case 15 => 3
+ case 20 => 4
+ case _ => 5
+ }
+}