diff options
author | Martin Odersky <odersky@gmail.com> | 2009-08-14 19:30:49 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-08-14 19:30:49 +0000 |
commit | d601240fe665e303436093b108dd203ace42c743 (patch) | |
tree | 110656b58b54b6843e6666a9e9e1736ae94c0987 /src | |
parent | 5e1deae36170e68a15dd6ffbbc3d902673892f59 (diff) | |
download | scala-d601240fe665e303436093b108dd203ace42c743.tar.gz scala-d601240fe665e303436093b108dd203ace42c743.tar.bz2 scala-d601240fe665e303436093b108dd203ace42c743.zip |
Blocks can now end in definitions.
Diffstat (limited to 'src')
-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 |