summaryrefslogtreecommitdiff
path: root/test/files/neg/nonlocal-warning.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/nonlocal-warning.scala')
-rw-r--r--test/files/neg/nonlocal-warning.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/nonlocal-warning.scala b/test/files/neg/nonlocal-warning.scala
new file mode 100644
index 0000000000..f908a86302
--- /dev/null
+++ b/test/files/neg/nonlocal-warning.scala
@@ -0,0 +1,18 @@
+class Foo {
+ def foo(l: List[Int]): Int = {
+ try l foreach { _ => return 5 }
+ catch { case x => 11 }
+ 22
+ }
+
+ val pf: PartialFunction[Throwable, Unit] = {
+ case x if false => ()
+ }
+
+ def bar(l: List[Int]): Int = {
+ try l foreach { _ => return 5 }
+ catch pf
+ finally println()
+ 22
+ }
+}