diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index a167180267..52cce11deb 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4868,9 +4868,10 @@ trait Typers extends Modes with Adaptations with Tags { for (cdef <- catches1 if 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 { - case Bind(name, Ident(_)) => warn(name) - case Ident(name) => warn(name) + case Bind(name, i@Ident(_)) if unbound(i) => warn(name) + case i@Ident(name) if unbound(i) => warn(name) case _ => } } |