diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-06-16 23:35:06 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-06-19 21:35:28 +0200 |
commit | 7d8527b40a3bd6d93cf155b39ee50577751f3e91 (patch) | |
tree | d02e00108568bfc8236782962f15ccc30b50446c /test/files/continuations-neg/trycatch2.scala | |
parent | 277dc7cf43566f8294bde4143107d9bfaa59e8e3 (diff) | |
download | scala-7d8527b40a3bd6d93cf155b39ee50577751f3e91.tar.gz scala-7d8527b40a3bd6d93cf155b39ee50577751f3e91.tar.bz2 scala-7d8527b40a3bd6d93cf155b39ee50577751f3e91.zip |
SI-2807 Resurrect and refine the promiscuous catch warning.
The previous incarnation didn't survive 4fb3473.
This version can be cleared by using a typed pattern: `catch { case _: Throwable => }`.
This is motivated by the recent appearance of such a catch in `util.Try`, and by battle
scars left by one too many processes bravely but stupidly catching and logging OutOfMemoryErrors.
-Y status has been skipped: this warning is enabled by default and can only be silenced
with use of a typed pattern.
Diffstat (limited to 'test/files/continuations-neg/trycatch2.scala')
-rw-r--r-- | test/files/continuations-neg/trycatch2.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/files/continuations-neg/trycatch2.scala b/test/files/continuations-neg/trycatch2.scala index d61419169b..d329a3b530 100644 --- a/test/files/continuations-neg/trycatch2.scala +++ b/test/files/continuations-neg/trycatch2.scala @@ -12,7 +12,7 @@ object Test { fatal[Int] cpsIntStringInt } catch { - case ex => + case ex: Throwable => cpsIntStringInt } @@ -20,7 +20,7 @@ object Test { fatal[Int] cpsIntStringInt } catch { - case ex => + case ex: Throwable => cpsIntStringInt } @@ -30,4 +30,4 @@ object Test { println(reset { foo2; "3" }) } -}
\ No newline at end of file +} |