diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-10 00:55:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-10 00:55:15 +0000 |
commit | 879e5af47db2ae6807aef26dd786e6ea920ac554 (patch) | |
tree | 7aecb05e2c9361689c16dec2a2c8473af6d0b4fd /src/compiler/scala/tools/nsc/backend | |
parent | e3e64e43659f53dd8f9cd5837f78a7e4378dc4c4 (diff) | |
download | scala-879e5af47db2ae6807aef26dd786e6ea920ac554.tar.gz scala-879e5af47db2ae6807aef26dd786e6ea920ac554.tar.bz2 scala-879e5af47db2ae6807aef26dd786e6ea920ac554.zip |
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.
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend')
4 files changed, 11 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/Members.scala b/src/compiler/scala/tools/nsc/backend/icode/Members.scala index 4e02371a7e..5aa76fad83 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Members.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Members.scala @@ -224,7 +224,7 @@ trait Members { self: ICodes => val nextBlock: mutable.Map[BasicBlock, BasicBlock] = mutable.HashMap.empty for (b <- code.blocks.toList if b.successors.length == 1; - val succ = b.successors.head; + succ = b.successors.head; if succ ne b; if succ.predecessors.length == 1; if succ.predecessors.head eq b; diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala index a82e81b858..c656219dc8 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala @@ -44,7 +44,7 @@ abstract class Liveness { gen.clear() kill.clear() - for (b <- m.code.blocks; val (g, k) = genAndKill(b)) { + for (b <- m.code.blocks; (g, k) = genAndKill(b)) { gen += (b -> g) kill += (b -> k) } diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala index 09718947f4..d9e0243c16 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala @@ -81,7 +81,7 @@ abstract class ReachingDefinitions { drops.clear() outStack.clear() - for (b <- m.code.blocks.toList; val (g, k) = genAndKill(b); val (d, st) = dropsAndGen(b)) { + for (b <- m.code.blocks.toList; (g, k) = genAndKill(b); (d, st) = dropsAndGen(b)) { gen += (b -> g) kill += (b -> k) drops += (b -> d) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index c0a9192c86..ab42f4176c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -421,11 +421,15 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with c.cunit.source.toString) var fieldList = List[String]() - for (f <- clasz.fields if f.symbol.hasGetter; - val g = f.symbol.getter(c.symbol); - val s = f.symbol.setter(c.symbol); - if g.isPublic && !(f.symbol.name startsWith "$")) // inserting $outer breaks the bean + for { + f <- clasz.fields + if f.symbol.hasGetter + g = f.symbol.getter(c.symbol) + s = f.symbol.setter(c.symbol) + if g.isPublic && !(f.symbol.name startsWith "$") // inserting $outer breaks the bean + } { fieldList = javaName(f.symbol) :: javaName(g) :: (if (s != NoSymbol) javaName(s) else null) :: fieldList + } val methodList = for (m <- clasz.methods if !m.symbol.isConstructor && |