summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-08 12:51:07 +0000
committerPaul Phillips <paulp@improving.org>2011-08-08 12:51:07 +0000
commitcda4650d4d6486d6dc07766cd00c92d4712cca3f (patch)
tree46eaf415f58b630a0fa04008d79fb7c9b06083ea /src/compiler
parent9e4bdd411cbc3db5064dcd01a9c35bd46508ceb4 (diff)
downloadscala-cda4650d4d6486d6dc07766cd00c92d4712cca3f.tar.gz
scala-cda4650d4d6486d6dc07766cd00c92d4712cca3f.tar.bz2
scala-cda4650d4d6486d6dc07766cd00c92d4712cca3f.zip
Looks like there was a little baby in the parse...
Looks like there was a little baby in the parser bathwater, or at least some bathwater still in the general shape of a baby. Apparently both old forms weren't deprecated. The spec does not suggest that the 'val' in for comprehension assignment is optional, but clearly it can't go anywhere for a while yet regardless. Will seek clarification. No review.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 28cb088f4e..5cbe83f274 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1642,8 +1642,11 @@ self =>
if (hasVal && !hasEq)
syntaxError(in.offset, "val in for comprehension must be followed by assignment")
- if (!hasVal && hasEq)
- syntaxError(in.offset, "assignment in for comprehension must be preceded by `val`")
+ if (!hasVal && hasEq) {
+ deprecationWarning(in.lastOffset, "for comprehension assignment without a `val' declaration is deprecated.")
+ // not yet, deprecated in 2.10.0.
+ // syntaxError(in.offset, "assignment in for comprehension must be preceded by `val`")
+ }
if (hasEq && eqOK) in.nextToken()
else accept(LARROW)