summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-12-12 15:22:32 -0800
committerPaul Phillips <paulp@improving.org>2012-12-12 15:22:32 -0800
commit89decde4272c1428f884fd4c4d293cb6a8c7af13 (patch)
tree7b102c96a5fe9c3b86a48ad8881e18c9061f38af /test/files/pos
parentcad4c1a7a70536f285623be2434f72ee5bbf601d (diff)
parenta9d2568b36c517b4691d2b5fcb60e6a8e30be3a5 (diff)
downloadscala-89decde4272c1428f884fd4c4d293cb6a8c7af13.tar.gz
scala-89decde4272c1428f884fd4c4d293cb6a8c7af13.tar.bz2
scala-89decde4272c1428f884fd4c4d293cb6a8c7af13.zip
Merge pull request #1749 from paulp/pr/6595
Fix for SI-6595, lost modifiers in early defs.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t6595.flags1
-rw-r--r--test/files/pos/t6595.scala18
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/t6595.flags b/test/files/pos/t6595.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/pos/t6595.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/pos/t6595.scala b/test/files/pos/t6595.scala
new file mode 100644
index 0000000000..437c0bcf05
--- /dev/null
+++ b/test/files/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
+ }
+}