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 36542cc9d9..0be7192471 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -5008,6 +5008,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)