summaryrefslogtreecommitdiff
path: root/test/files/neg/switch.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
commitb6778be91900b8161e705dc2598ef7af86842b0b (patch)
treed15e8ec18a37eec212f50f1ace27714d7e7d4d34 /test/files/neg/switch.scala
parentac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff)
downloadscala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz
scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2
scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip
Begone t1737...
Diffstat (limited to 'test/files/neg/switch.scala')
-rw-r--r--test/files/neg/switch.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/files/neg/switch.scala b/test/files/neg/switch.scala
index da7c867ba0..a3dfd869d6 100644
--- a/test/files/neg/switch.scala
+++ b/test/files/neg/switch.scala
@@ -16,44 +16,44 @@ object Main {
case 'f' | 'g' => true
case _ => false
}
-
+
def succ2(c: Char) = (c: @switch) match {
case 'A' | 'B' | 'C' => true
case Other.C2 => true
case Other.C4 => true
case _ => false
}
-
+
// has a guard
def fail1(c: Char) = (c: @switch) match {
case 'A' | 'B' | 'C' => true
case x if x == 'A' => true
case _ => false
}
-
+
// throwing in @unchecked on the next two to make sure
// multiple annotations are processed correctly
-
+
// thinks a val in an object is constant... so naive
def fail2(c: Char) = (c: @switch @unchecked) match {
case 'A' => true
case Other.C1 => true
case _ => false
}
-
+
// more naivete
def fail3(c: Char) = (c: @unchecked @switch) match {
case 'A' => true
case Other.C3 => true
case _ => false
}
-
+
// guard case done correctly
def succ3(c: Char) = (c: @switch) match {
case 'A' | 'B' | 'C' => true
case x => x == 'A'
}
-
+
// some ints just to mix it up a bit
def succ4(x: Int, y: Int) = ((x+y): @switch) match {
case 1 => 5
@@ -62,5 +62,5 @@ object Main {
case 4 => 50
case 5|6|7|8 => 100
case _ => -1
- }
+ }
}