summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/bug4148.check3
-rw-r--r--test/files/run/bug4148.scala9
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/bug4148.check b/test/files/run/bug4148.check
new file mode 100644
index 0000000000..544b0d19d1
--- /dev/null
+++ b/test/files/run/bug4148.check
@@ -0,0 +1,3 @@
+cce1
+5
+100
diff --git a/test/files/run/bug4148.scala b/test/files/run/bug4148.scala
new file mode 100644
index 0000000000..a7d181268d
--- /dev/null
+++ b/test/files/run/bug4148.scala
@@ -0,0 +1,9 @@
+object Test {
+ val x1 = try { "aaa".asInstanceOf[Int] } catch { case _ => "cce1" }
+ val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _ => "cce2" }
+ val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _ => "cce3" }
+
+ def main(args: Array[String]): Unit = {
+ List(x1, x2, x3) foreach println
+ }
+}