diff options
Diffstat (limited to 'src/compiler')
-rwxr-xr-x | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 7ff5aa3dca..787e96d1d8 100755 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2520,7 +2520,7 @@ self => } else if (isDefIntro || isLocalModifier || in.token == AT) { stats ++= localDef if (in.token == RBRACE || in.token == CASE) { - syntaxError("block must end in result expression, not in definition", false) + //syntaxError("block must end in result expression, not in definition", false) stats += Literal(()).setPos(o2p(in.offset)) } else acceptStatSep() } else if (isStatSep) { diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 5e8fbca81b..b716f6ac16 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -860,8 +860,9 @@ abstract class RefChecks extends InfoTransform { var result = tree def doTypeTraversal(f: (Type) => Unit) = - if (!inPattern) - new ForEachTypeTraverser(f) traverse tree.tpe + if (!inPattern) { + for (tp <- tree.tpe) f(tp) + } // Apply RefChecks to annotations. Makes sure the annotations conform to // type bounds (bug #935), issues deprecation warnings for symbols used |