diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-23 23:13:01 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-23 23:13:01 -0700 |
commit | b29e515205581d58d239464daadf37f0f1537519 (patch) | |
tree | d88c0547a87ef8f03bd06ff557f14065581a93c9 /src/compiler | |
parent | 693a36d7692628c5765276a2d7390aae75eed5e5 (diff) | |
parent | 58abe39c9d8d75bc2c5ca27e1b8c0c33de9e6824 (diff) | |
download | scala-b29e515205581d58d239464daadf37f0f1537519.tar.gz scala-b29e515205581d58d239464daadf37f0f1537519.tar.bz2 scala-b29e515205581d58d239464daadf37f0f1537519.zip |
Merge pull request #2653 from retronym/ticket/7433
SI-7433 Fix spurious warning about catching control throwable
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 64f4e579e1..e2ce2743f7 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -187,8 +187,14 @@ abstract class UnCurry extends InfoTransform val keyDef = ValDef(key, New(ObjectTpe)) val tryCatch = Try(body, pat -> rhs) - for (Try(t, catches, _) <- body ; cdef <- catches ; if treeInfo catchesThrowable cdef) + import treeInfo.{catchesThrowable, isSyntheticCase} + for { + Try(t, catches, _) <- body + cdef <- catches + if catchesThrowable(cdef) && !isSyntheticCase(cdef) + } { unit.warning(body.pos, "catch block may intercept non-local return from " + meth) + } Block(List(keyDef), tryCatch) } |