From 879e5af47db2ae6807aef26dd786e6ea920ac554 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 10 Aug 2011 00:55:15 +0000 Subject: Reversed the values of "is" and "is not" in rec... Reversed the values of "is" and "is not" in recent for comprehension deprecation. DO NOT BLOW HATCH REPEAT DO NOT BLOW HATCH "Roger! Hatch blown." Events reveal it was all baby, no bathwater. It turns out that the specification is merely a document, not infallible holy writ as we had all previously believed. So it is not the ABSENCE of val in a for comprehension assignment which is deprecated, it is the PRESENCE of val. Summarizing again, more accurately perhaps: for (x <- 1 to 5 ; y = x) yield x+y // THAT's the one for (val x <- 1 to 5 ; y = x) yield x+y // fail for (val x <- 1 to 5 ; val y = x) yield x+y // fail for (x <- 1 to 5 ; val y = x) yield x+y // deprecated No review. --- .../plugin/scala/tools/selectivecps/SelectiveANFTransform.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/continuations') diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala index 5f57b0ac10..001a1b4b62 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala @@ -78,7 +78,7 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with case Match(selector, cases) if (ext.isDefined && getAnswerTypeAnn(body.tpe).isEmpty) => val cases1 = for { cd @ CaseDef(pat, guard, caseBody) <- cases - val caseBody1 = transExpr(body, None, ext) + caseBody1 = transExpr(body, None, ext) } yield { treeCopy.CaseDef(cd, transform(pat), transform(guard), caseBody1) } @@ -201,7 +201,7 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with val caseVals = for { cd @ CaseDef(pat, guard, body) <- cases - val bodyVal = transExpr(body, cpsA2, cpsR2) + bodyVal = transExpr(body, cpsA2, cpsR2) } yield { treeCopy.CaseDef(cd, transform(pat), transform(guard), bodyVal) } @@ -233,7 +233,7 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with val catchVals = for { cd @ CaseDef(pat, guard, body) <- catches - val bodyVal = transExpr(body, cpsA, cpsR) + bodyVal = transExpr(body, cpsA, cpsR) } yield { treeCopy.CaseDef(cd, transform(pat), transform(guard), bodyVal) } -- cgit v1.2.3