summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 910c5256c2..fa5603dcb8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4993,6 +4993,13 @@ trait Typers extends Adaptations with Tags {
}
def typedTry(tree: Try) = {
+ tree match {
+ case Try(_, Nil, EmptyTree) =>
+ if (!isPastTyper) context.warning(tree.pos,
+ "A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled.")
+ case _ =>
+ }
+
var block1 = typed(tree.block, pt)
var catches1 = typedCases(tree.catches, ThrowableClass.tpe, pt)