diff options
-rw-r--r-- | sources/scalac/ast/parser/Parser.java | 5 | ||||
-rw-r--r-- | test/files/pos/exceptions.scala | 2 | ||||
-rw-r--r-- | test/pos/exceptions.scala | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index a91a857da7..f532c78cd1 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -1431,10 +1431,7 @@ public class Parser implements Tokens { TypeDef[] tparams = typeParamClauseOpt(); ValDef[][] vparams = paramClauses(); Tree restype = typedOpt(); - if (s.token == LBRACE) - return make.DefDef(pos, mods, name, tparams, vparams, - restype, blockExpr()); - else if (s.token == EQUALS || restype == Tree.Empty) + if (s.token == EQUALS || restype == Tree.Empty) return make.DefDef(pos, mods, name, tparams, vparams, restype, equalsExpr()); else diff --git a/test/files/pos/exceptions.scala b/test/files/pos/exceptions.scala index dc7f730f0d..4c7ffa35c8 100644 --- a/test/files/pos/exceptions.scala +++ b/test/files/pos/exceptions.scala @@ -4,7 +4,7 @@ module test { //def error[a](x: String):a = new java.lang.RuntimeException(x) throw; - def main(): Unit { + def main(): Unit = { try { try { error("hi!"); diff --git a/test/pos/exceptions.scala b/test/pos/exceptions.scala index dc7f730f0d..4c7ffa35c8 100644 --- a/test/pos/exceptions.scala +++ b/test/pos/exceptions.scala @@ -4,7 +4,7 @@ module test { //def error[a](x: String):a = new java.lang.RuntimeException(x) throw; - def main(): Unit { + def main(): Unit = { try { try { error("hi!"); |