summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-08 06:56:21 +0000
committerPaul Phillips <paulp@improving.org>2011-08-08 06:56:21 +0000
commit8b28292b5379a34fad0599335116b9e54ee44e20 (patch)
tree654c93a14a26e802948aa80664efb7aea7b448d3 /test/files/run
parentbe31934db38a93468b6390e783ca377da6283c19 (diff)
downloadscala-8b28292b5379a34fad0599335116b9e54ee44e20.tar.gz
scala-8b28292b5379a34fad0599335116b9e54ee44e20.tar.bz2
scala-8b28292b5379a34fad0599335116b9e54ee44e20.zip
Fixing all the tests and source which still use...
Fixing all the tests and source which still use the old for comprehension syntax with vals where there are no vals and no vals where there are vals. No review.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/Course-2002-08.scala12
-rw-r--r--test/files/run/Course-2002-13.scala11
-rw-r--r--test/files/run/bug1192.scala2
-rw-r--r--test/files/run/forvaleq.scala14
-rw-r--r--test/files/run/lazy-leaks.scala2
-rw-r--r--test/files/run/mapConserve.scala2
-rw-r--r--test/files/run/t1939.scala2
7 files changed, 22 insertions, 23 deletions
diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala
index 2e4b5111a9..2423bbc36a 100644
--- a/test/files/run/Course-2002-08.scala
+++ b/test/files/run/Course-2002-08.scala
@@ -135,9 +135,9 @@ object M3 {
object M4 {
def test = {
- for (val i <- range(1, 4)) { Console.print(i + " ") };
+ for (i <- range(1, 4)) { Console.print(i + " ") };
Console.println;
- Console.println(for (val i <- range(1, 4)) yield i);
+ Console.println(for (i <- range(1, 4)) yield i);
Console.println;
}
}
@@ -561,14 +561,14 @@ class Main() extends CircuitSimulator() {
val outNum = 1 << n;
val in = new Wire();
- val ctrl = for (val x <- range(0,n)) yield { new Wire() };
- val out = for (val x <- range(0,outNum)) yield { new Wire() };
+ val ctrl = for (x <- range(0,n)) yield { new Wire() };
+ val out = for (x <- range(0,outNum)) yield { new Wire() };
demux(in, ctrl.reverse, out.reverse);
probe("in", in);
- for (val Pair(x,c) <- range(0,n) zip ctrl) { probe("ctrl" + x, c) }
- for (val Pair(x,o) <- range(0,outNum) zip out) { probe("out" + x, o) }
+ for (Pair(x,c) <- range(0,n) zip ctrl) { probe("ctrl" + x, c) }
+ for (Pair(x,o) <- range(0,outNum) zip out) { probe("out" + x, o) }
in.setSignal(true);
run;
diff --git a/test/files/run/Course-2002-13.scala b/test/files/run/Course-2002-13.scala
index c016d41a90..c266af8c32 100644
--- a/test/files/run/Course-2002-13.scala
+++ b/test/files/run/Course-2002-13.scala
@@ -116,7 +116,7 @@ object Programs {
(lhs.tyvars ::: (rhs flatMap (t => t.tyvars))).distinct;
def newInstance = {
var s: Subst = List();
- for (val a <- tyvars) { s = Binding(a, newVar(a)) :: s }
+ for (a <- tyvars) { s = Binding(a, newVar(a)) :: s }
Clause(lhs map s, rhs map (t => t map s))
}
override def toString() =
@@ -141,9 +141,9 @@ object Programs {
if (solve1(qs, s).isEmpty) Stream.cons(s, Stream.empty)
else Stream.empty
case q :: query1 =>
- for (val clause <- list2stream(clauses);
- val s1 <- tryClause(clause.newInstance, q, s);
- val s2 <- solve1(query1, s1)) yield s2
+ for (clause <- list2stream(clauses);
+ s1 <- tryClause(clause.newInstance, q, s);
+ s2 <- solve1(query1, s1)) yield s2
}
def solve1(query: List[Term], s: Subst): Stream[Subst] = {
@@ -154,8 +154,7 @@ object Programs {
def tryClause(c: Clause, q: Term, s: Subst): Stream[Subst] = {
if (debug) Console.println("trying " + c);
- for (val s1 <- option2stream(unify(q, c.lhs, s));
- val s2 <- solve1(c.rhs, s1)) yield s2;
+ for (s1 <- option2stream(unify(q, c.lhs, s)); s2 <- solve1(c.rhs, s1)) yield s2;
}
solve1(query, List())
diff --git a/test/files/run/bug1192.scala b/test/files/run/bug1192.scala
index a32cbf5c98..3222bb0a37 100644
--- a/test/files/run/bug1192.scala
+++ b/test/files/run/bug1192.scala
@@ -1,7 +1,7 @@
object Test extends App {
val v1: Array[Array[Int]] = Array(Array(1, 2), Array(3, 4))
def f[T](w: Array[Array[T]]) {
- for (val r <- w) println(r.deep.toString)
+ for (r <- w) println(r.deep.toString)
}
f(v1)
}
diff --git a/test/files/run/forvaleq.scala b/test/files/run/forvaleq.scala
index 8c1824a769..40dbfd099a 100644
--- a/test/files/run/forvaleq.scala
+++ b/test/files/run/forvaleq.scala
@@ -24,7 +24,7 @@ object Test {
val input = L.range(0,20)
val oddFirstTimesTwo =
for {x <- input
- xf = firstDigit(x)
+ val xf = firstDigit(x)
if xf % 2 == 1}
yield x*2
println(oddFirstTimesTwo)
@@ -36,9 +36,9 @@ object Test {
val input = L.range(0, 20)
val oddFirstTimesTwo =
for {x <- input
- xf = firstDigit(x)
- yf = x - firstDigit(x) / 10
- (a, b) = (xf - yf, xf + yf)
+ val xf = firstDigit(x)
+ val yf = x - firstDigit(x) / 10
+ val (a, b) = (xf - yf, xf + yf)
if xf % 2 == 1}
yield a + b
println(oddFirstTimesTwo)
@@ -51,7 +51,7 @@ object Test {
val input = L.range(0, 20).iterator
val oddFirstTimesTwo =
for {x <- input
- xf = firstDigit(x)
+ val xf = firstDigit(x)
if xf % 2 == 1}
yield x*2
println(oddFirstTimesTwo.toList)
@@ -63,7 +63,7 @@ object Test {
val input = L.range(0,20)
val oddFirstTimesTwo =
for {x <- input
- xf = firstDigit(x)
+ val xf = firstDigit(x)
if xf % 2 == 1}
yield xf*2
println(oddFirstTimesTwo)
@@ -80,7 +80,7 @@ object Test {
val input = L.range(0,20)
for {x <- input
- xf = fdct(x)
+ val xf = fdct(x)
if xf % 2 == 1}
yield xf
diff --git a/test/files/run/lazy-leaks.scala b/test/files/run/lazy-leaks.scala
index e3db55aa09..22a3770d07 100644
--- a/test/files/run/lazy-leaks.scala
+++ b/test/files/run/lazy-leaks.scala
@@ -9,7 +9,7 @@ object Test extends App
// This test requires 4 Mb of RAM if Lazy is discarding thunks
// It consumes 4 Gb of RAM if Lazy is not discarding thunks
- for (val idx <- Iterator.range(0, 1024)) {
+ for (idx <- Iterator.range(0, 1024)) {
val data = new Array[Int](1024*1024)
val lz: Lazy = new Lazy(data.length)
buffer += lz
diff --git a/test/files/run/mapConserve.scala b/test/files/run/mapConserve.scala
index a285113b11..176e38bed4 100644
--- a/test/files/run/mapConserve.scala
+++ b/test/files/run/mapConserve.scala
@@ -30,7 +30,7 @@ object Test {
def main(args: Array[String]) {
for (length <- 0 to maxListLength;
bitmap <- 0 until (1 << length);
- data = List.range(0, length) map { x: Int =>
+ val data = List.range(0, length) map { x: Int =>
if ((bitmap & (1 << x)) != 0) BigInt(x+16)
else BigInt(x)
})
diff --git a/test/files/run/t1939.scala b/test/files/run/t1939.scala
index 7626e8bc1a..5a36348761 100644
--- a/test/files/run/t1939.scala
+++ b/test/files/run/t1939.scala
@@ -25,7 +25,7 @@ object Test extends App {
def f(ts: List[tType]): Unit = {
- for (t <- ts; m = t.module) {}
+ for (t <- ts; val m = t.module) {}
ts.map(t => t.module).foreach { _ => () }
// ts.map(t => (t : T).module).foreach { _ => () } // runs successfully
}