diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-24 16:36:08 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-24 16:36:08 -0800 |
commit | a89669b117c629bb7686fb794f46c3027bacdb7e (patch) | |
tree | 0aac0560dbf0b262f5df813b9e26d3c51779bcbd /src | |
parent | edc9f123cac5b06894d50adfb61cc6cd1456eedb (diff) | |
parent | 8f498847020c5623559fa42d5d23e44fb74c8d22 (diff) | |
download | scala-a89669b117c629bb7686fb794f46c3027bacdb7e.tar.gz scala-a89669b117c629bb7686fb794f46c3027bacdb7e.tar.bz2 scala-a89669b117c629bb7686fb794f46c3027bacdb7e.zip |
Merge pull request #1935 from retronym/ticket/6994
SI-6994 Avoid spurious promiscuous catch warning
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index cbcddba487..5ad6c6bd73 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -5367,7 +5367,7 @@ trait Typers extends Modes with Adaptations with Tags { var block1 = typed(tree.block, pt) var catches1 = typedCases(tree.catches, ThrowableClass.tpe, pt) - for (cdef <- catches1 if cdef.guard.isEmpty) { + for (cdef <- catches1 if !isPastTyper && cdef.guard.isEmpty) { def warn(name: Name) = context.warning(cdef.pat.pos, s"This catches all Throwables. If this is really intended, use `case ${name.decoded} : Throwable` to clear this warning.") def unbound(t: Tree) = t.symbol == null || t.symbol == NoSymbol cdef.pat match { |