summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
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)