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. --- src/scalacheck/org/scalacheck/Arbitrary.scala | 2 +- src/scalacheck/org/scalacheck/Gen.scala | 2 +- src/scalacheck/org/scalacheck/Pretty.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/scalacheck/org') diff --git a/src/scalacheck/org/scalacheck/Arbitrary.scala b/src/scalacheck/org/scalacheck/Arbitrary.scala index 608b3b9fac..91d56b0aec 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] - val d = new Date + 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 f1bf3c87de..a253b040cd 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)) - val allGs = gs ++ (g1::g2::Nil) + 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 9e215c4cb7..f59ac315c7 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 - val ys = xs - () + ys = xs - () if !ys.isEmpty } yield round(r*100)+"% " + ys.mkString(", ") }.mkString("\n") -- cgit v1.2.3