summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala2
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala8
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala12
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala2
-rw-r--r--src/library/scala/Responder.scala5
-rw-r--r--src/scalacheck/org/scalacheck/Arbitrary.scala2
-rw-r--r--src/scalacheck/org/scalacheck/Gen.scala2
-rw-r--r--src/scalacheck/org/scalacheck/Pretty.scala2
9 files changed, 17 insertions, 20 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala
index 81962f89d8..4a2d8e9f08 100644
--- a/src/compiler/scala/reflect/internal/Types.scala
+++ b/src/compiler/scala/reflect/internal/Types.scala
@@ -5645,7 +5645,7 @@ A type's typeSymbol should never be inspected directly.
try {
globalGlbDepth += 1
val dss = ts flatMap refinedToDecls
- for (ds <- dss; val sym <- ds.iterator)
+ for (ds <- dss; sym <- ds.iterator)
if (globalGlbDepth < globalGlbLimit && !(glbThisType specializes sym))
try {
addMember(glbThisType, glbRefined, glbsym(sym))
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 97da13abfc..a82e81b858 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala
@@ -34,7 +34,6 @@ abstract class Liveness {
final class LivenessAnalysis extends DataFlowAnalysis[livenessLattice.type] {
type P = BasicBlock
val lattice = livenessLattice
-
var method: IMethod = _
val gen: mutable.Map[BasicBlock, Set[Local]] = perRunCaches.newMap()
@@ -42,11 +41,10 @@ abstract class Liveness {
def init(m: IMethod) {
this.method = m
- gen.clear
- kill.clear
+ gen.clear()
+ kill.clear()
- for (b <- m.code.blocks;
- (g, k) = genAndKill(b)) {
+ for (b <- m.code.blocks; val (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 cc4619c68f..09718947f4 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala
@@ -75,12 +75,13 @@ abstract class ReachingDefinitions {
def init(m: IMethod) {
this.method = m
- gen.clear; kill.clear
- drops.clear; outStack.clear
- for (b <- m.code.blocks.toList;
- (g, k) = genAndKill(b);
- (d, st) = dropsAndGen(b)) {
+ gen.clear()
+ kill.clear()
+ drops.clear()
+ outStack.clear()
+
+ for (b <- m.code.blocks.toList; val (g, k) = genAndKill(b); val (d, st) = dropsAndGen(b)) {
gen += (b -> g)
kill += (b -> k)
drops += (b -> d)
@@ -96,7 +97,6 @@ abstract class ReachingDefinitions {
m.exh foreach { e =>
in(e.startBlock) = lattice.IState(new ListSet[Definition], List(new ListSet[(BasicBlock, Int)]))
}
-
}
}
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index d43dfdd3d9..81d7e8b373 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -856,7 +856,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
*/
def addCheckedGetters(clazz: Symbol, stats: List[Tree]): List[Tree] = {
- val stats1 = for (stat <- stats; sym = stat.symbol) yield stat match {
+ val stats1 = for (stat <- stats; val sym = stat.symbol) yield stat match {
case DefDef(mods, name, tp, vp, tpt, rhs)
if sym.isLazy && rhs != EmptyTree && !clazz.isImplClass =>
assert(fieldOffset.isDefinedAt(sym))
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index 35a736d34e..f4a7ad678a 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -1512,7 +1512,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
val (oldtparams, newtparams) = reskolemize(tparams)
// create fresh symbols for value parameters to hold the skolem types
- val vparamss1 = List(for (vdef <- vparamss.head; param = vdef.symbol) yield {
+ val vparamss1 = List(for (vdef <- vparamss.head; val param = vdef.symbol) yield {
ValDef(param.cloneSymbol(symbol).setInfo(param.info.substSym(oldtparams, newtparams)))
})
diff --git a/src/library/scala/Responder.scala b/src/library/scala/Responder.scala
index 919ba130d4..189d75a4ae 100644
--- a/src/library/scala/Responder.scala
+++ b/src/library/scala/Responder.scala
@@ -46,12 +46,11 @@ object Responder {
}
def loop[A](r: Responder[Unit]): Responder[Nothing] =
- for (_ <- r; val y <- loop(r)) yield y
+ for (_ <- r; y <- loop(r)) yield y
def loopWhile[A](cond: => Boolean)(r: Responder[Unit]): Responder[Unit] =
- if (cond) for (_ <- r; val y <- loopWhile(cond)(r)) yield y
+ if (cond) for (_ <- r; y <- loopWhile(cond)(r)) yield y
else constant(())
-
}
/** Instances of responder are the building blocks of small programs
diff --git a/src/scalacheck/org/scalacheck/Arbitrary.scala b/src/scalacheck/org/scalacheck/Arbitrary.scala
index 91d56b0aec..608b3b9fac 100644
--- a/src/scalacheck/org/scalacheck/Arbitrary.scala
+++ b/src/scalacheck/org/scalacheck/Arbitrary.scala
@@ -143,7 +143,7 @@ object Arbitrary {
/** Arbitrary instance of Date */
implicit lazy val arbDate: Arbitrary[Date] = Arbitrary(for {
l <- arbitrary[Long]
- d = new Date
+ val d = new Date
} yield new Date(d.getTime + l))
/** Arbitrary instance of Throwable */
diff --git a/src/scalacheck/org/scalacheck/Gen.scala b/src/scalacheck/org/scalacheck/Gen.scala
index a253b040cd..f1bf3c87de 100644
--- a/src/scalacheck/org/scalacheck/Gen.scala
+++ b/src/scalacheck/org/scalacheck/Gen.scala
@@ -399,7 +399,7 @@ object Gen {
/** A generator that picks a given number of elements from a list, randomly */
def pick[T](n: Int, g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[Seq[T]] = for {
is <- pick(n, 0 until (gs.size+2))
- allGs = gs ++ (g1::g2::Nil)
+ val allGs = gs ++ (g1::g2::Nil)
xs <- sequence[List,T](is.toList.map(allGs(_)))
} yield xs
diff --git a/src/scalacheck/org/scalacheck/Pretty.scala b/src/scalacheck/org/scalacheck/Pretty.scala
index f59ac315c7..9e215c4cb7 100644
--- a/src/scalacheck/org/scalacheck/Pretty.scala
+++ b/src/scalacheck/org/scalacheck/Pretty.scala
@@ -86,7 +86,7 @@ object Pretty {
"> Collected test data: " / {
for {
(xs,r) <- fm.getRatios
- ys = xs - ()
+ val ys = xs - ()
if !ys.isEmpty
} yield round(r*100)+"% " + ys.mkString(", ")
}.mkString("\n")