summaryrefslogtreecommitdiff
path: root/test/files/neg/nonlocal-warning.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-02 10:37:13 -0700
committerPaul Phillips <paulp@improving.org>2012-10-04 16:08:31 -0700
commitd7354838948be58b8045e1218a9c757d9b90df76 (patch)
treef034b77a430cb98fc6f5add55e645be28b0cf21e /test/files/neg/nonlocal-warning.scala
parent1f99df2c66cb1933dd4db74aa872497a4e26975b (diff)
downloadscala-d7354838948be58b8045e1218a9c757d9b90df76.tar.gz
scala-d7354838948be58b8045e1218a9c757d9b90df76.tar.bz2
scala-d7354838948be58b8045e1218a9c757d9b90df76.zip
Fix for spurious warning.
Eliminates spurious "catch block may intercept non-local return" seen in recent builds of master. Unified some catch logic in TreeInfo, and removed some which never worked.
Diffstat (limited to 'test/files/neg/nonlocal-warning.scala')
-rw-r--r--test/files/neg/nonlocal-warning.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/neg/nonlocal-warning.scala b/test/files/neg/nonlocal-warning.scala
index cc98bd631a..f908a86302 100644
--- a/test/files/neg/nonlocal-warning.scala
+++ b/test/files/neg/nonlocal-warning.scala
@@ -4,4 +4,15 @@ class Foo {
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
+ }
}