From cda4650d4d6486d6dc07766cd00c92d4712cca3f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 8 Aug 2011 12:51:07 +0000 Subject: 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. --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3