summaryrefslogtreecommitdiff
path: root/test/files/neg/check-dead.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/check-dead.scala')
-rw-r--r--test/files/neg/check-dead.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/files/neg/check-dead.scala b/test/files/neg/check-dead.scala
new file mode 100644
index 0000000000..851e81d886
--- /dev/null
+++ b/test/files/neg/check-dead.scala
@@ -0,0 +1,34 @@
+package dummy
+
+object Error {
+ def soSorry(msg: String = "sorry"): Nothing =
+ throw new Exception("we have a problem: "+msg)
+}
+
+class NoDeads {
+ def x = synchronized { throw new Exception }
+ def y[T](arg: T) = println("foo")
+ def z = this.y(throw new Exception)
+
+ def dummy1: Int = synchronized {
+ val i = 10 + 2
+ return i
+ }
+ def dummy1b: Int = synchronized {
+ val i = 10 + 2
+ i
+ }
+
+ def dummy2: String = Error.soSorry("we're dummies")
+}
+
+class Deads {
+ def x1 = synchronized {
+ throw new Exception
+ 5 * 5
+ }
+ def x2: Int = synchronized {
+ throw new Exception
+ return 5
+ }
+} \ No newline at end of file