diff options
author | Martin Odersky <odersky@gmail.com> | 2004-09-02 16:19:06 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2004-09-02 16:19:06 +0000 |
commit | 7320ca34aad20a1c47715d265a85da7274b0eaf4 (patch) | |
tree | d463653247060d0d7d5b2139cbdada138215e554 /test/files | |
parent | 5c259cbc76648b0e36e27b47e07a6066704c3f52 (diff) | |
download | scala-7320ca34aad20a1c47715d265a85da7274b0eaf4.tar.gz scala-7320ca34aad20a1c47715d265a85da7274b0eaf4.tar.bz2 scala-7320ca34aad20a1c47715d265a85da7274b0eaf4.zip |
*** empty log message ***
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/bug31.scala | 2 | ||||
-rw-r--r-- | test/files/pos/bug76.scala | 2 | ||||
-rw-r--r-- | test/files/pos/bug93.scala | 2 | ||||
-rw-r--r-- | test/files/run/Course-2002-01.scala | 2 | ||||
-rw-r--r-- | test/files/run/Course-2002-03.scala | 10 | ||||
-rw-r--r-- | test/files/run/Course-2002-04.scala | 2 | ||||
-rw-r--r-- | test/files/run/Course-2002-08.scala | 2 | ||||
-rw-r--r-- | test/files/run/Course-2002-13.scala | 2 | ||||
-rw-r--r-- | test/files/run/bridges.scala | 2 | ||||
-rw-r--r-- | test/files/run/bugs.scala | 4 | ||||
-rw-r--r-- | test/files/run/enums.scala | 2 | ||||
-rw-r--r-- | test/files/run/literals.scala | 2 | ||||
-rw-r--r-- | test/files/run/runtime.scala | 2 | ||||
-rw-r--r-- | test/files/run/tailcalls.scala | 2 |
14 files changed, 19 insertions, 19 deletions
diff --git a/test/files/pos/bug31.scala b/test/files/pos/bug31.scala index 607dd4ce4f..92f33bfd02 100644 --- a/test/files/pos/bug31.scala +++ b/test/files/pos/bug31.scala @@ -4,7 +4,7 @@ object Main { def ensure(postcondition: a => Boolean): a } - def require[a](def precondition: Boolean)(def command: a): Ensure[a] = + def require[a](precondition: => Boolean)(command: => a): Ensure[a] = if (precondition) new Ensure[a] { def ensure(postcondition: a => Boolean): a = { diff --git a/test/files/pos/bug76.scala b/test/files/pos/bug76.scala index 07cddd714f..5419cf5154 100644 --- a/test/files/pos/bug76.scala +++ b/test/files/pos/bug76.scala @@ -1,6 +1,6 @@ // This is extracted from a test file => don't add a new test file. object bug { - def foo(def i: Int): Int = 0; + def foo(i: => Int): Int = 0; def bar: Int = { var i: Int = 0; diff --git a/test/files/pos/bug93.scala b/test/files/pos/bug93.scala index f3441fe9c3..d648d773b0 100644 --- a/test/files/pos/bug93.scala +++ b/test/files/pos/bug93.scala @@ -1,4 +1,4 @@ object Bug { - def f(def cond: Boolean) = while (cond == false) {}; + def f(cond: => Boolean) = while (cond == false) {}; // no bug with "false == cond" } diff --git a/test/files/run/Course-2002-01.scala b/test/files/run/Course-2002-01.scala index 11d29540af..1e97cf0886 100644 --- a/test/files/run/Course-2002-01.scala +++ b/test/files/run/Course-2002-01.scala @@ -41,7 +41,7 @@ object M0 { def loop: Int = loop; def first(x: Int, y: Int) = x; - def constOne(x: Int, def y: Int) = 1; + def constOne(x: Int, y: => Int) = 1; java.lang.System.out.println(constOne(1, loop)); diff --git a/test/files/run/Course-2002-03.scala b/test/files/run/Course-2002-03.scala index f84625f2b3..c0e3cecfc6 100644 --- a/test/files/run/Course-2002-03.scala +++ b/test/files/run/Course-2002-03.scala @@ -181,12 +181,12 @@ object M5 { object M6 { trait Boolean { - def ifThenElse[a](def t: a)(def e: a): a; + def ifThenElse[a](t: => a)(e: => a): a; def ! : Boolean = ifThenElse[Boolean](new False())(new True()); - def && (def x: Boolean): Boolean = ifThenElse[Boolean](x)(new False()); - def || (def x: Boolean): Boolean = ifThenElse[Boolean](new True())(x); + def && (x: => Boolean): Boolean = ifThenElse[Boolean](x)(new False()); + def || (x: => Boolean): Boolean = ifThenElse[Boolean](new True())(x); // !!! def == (x: Boolean): Boolean = ifThenElse[Boolean](x)(x.!); // !!! def != (x: Boolean): Boolean = ifThenElse[Boolean](x.!)(x); @@ -196,9 +196,9 @@ object M6 { def >= (x: Boolean): Boolean = ifThenElse[Boolean](new True())(x.!); } class True() extends Boolean { // !!! class -> object - def ifThenElse[a](def t: a)(def e: a): a = t } + def ifThenElse[a](t: => a)(e: => a): a = t } class False() extends Boolean { // !!! class -> object - def ifThenElse[a](def t: a)(def e: a): a = e } + def ifThenElse[a](t: => a)(e: => a): a = e } } //############################################################################ diff --git a/test/files/run/Course-2002-04.scala b/test/files/run/Course-2002-04.scala index e74711d454..d14af43a96 100644 --- a/test/files/run/Course-2002-04.scala +++ b/test/files/run/Course-2002-04.scala @@ -47,7 +47,7 @@ object M1 { def mergesort[a] (less : (a,a) => Boolean) (xs: Array[a]): Unit = { - def While(def c: Boolean)(def b: Unit): Unit = + def While(c: => Boolean)(b: => Unit): Unit = if (c) { b ; While(c)(b) } else (); def swap(i: Int, j: Int): Unit = { diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala index de6b497fde..0c0926fa09 100644 --- a/test/files/run/Course-2002-08.scala +++ b/test/files/run/Course-2002-08.scala @@ -91,7 +91,7 @@ object M1 { object M2 { - def While(def condition: Boolean)(def command: Unit): Unit = + def While(condition: => Boolean)(command: => Unit): Unit = if (condition) { command; While(condition)(command) } else { diff --git a/test/files/run/Course-2002-13.scala b/test/files/run/Course-2002-13.scala index 022bb77ac5..cd9360fb97 100644 --- a/test/files/run/Course-2002-13.scala +++ b/test/files/run/Course-2002-13.scala @@ -223,7 +223,7 @@ class Parser(s: String) { def syntaxError(msg: String): Unit = error(msg + ", but " + token + " found"); - def rep[a](def p: a): List[a] = { + def rep[a](p: => a): List[a] = { val t = p; if (token == ",") { token = it.next; t :: rep(p) } else List(t) } diff --git a/test/files/run/bridges.scala b/test/files/run/bridges.scala index 8c6c013ae1..91fd277f57 100644 --- a/test/files/run/bridges.scala +++ b/test/files/run/bridges.scala @@ -3580,7 +3580,7 @@ abstract class BarYIf[Y] { class I ; def f: I = {bar; null}; f; } object Test { var errors: Int = 0; - def test(name: String, def test: Any, count: Int, value: String) = { + def test(name: String, test: => Any, count: Int, value: String) = { try { Help.init; test; diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala index 31c82eb490..b0a26d92e3 100644 --- a/test/files/run/bugs.scala +++ b/test/files/run/bugs.scala @@ -300,7 +300,7 @@ object Bug257Test { def f1(x: Unit): Unit = (); def f2(x: Unit)(y: Unit): Unit = (); - def f(def x: Unit) = { + def f(x: => Unit) = { f1(x); f2(x); } @@ -404,7 +404,7 @@ object Bug328Test { object Test { var errors: Int = 0; - def test(bug: Int, def test: Unit): Unit = { + def test(bug: Int, test: => Unit): Unit = { System.out.println("<<< bug " + bug); try { test; diff --git a/test/files/run/enums.scala b/test/files/run/enums.scala index 91fea177ad..5af6577ba3 100644 --- a/test/files/run/enums.scala +++ b/test/files/run/enums.scala @@ -53,7 +53,7 @@ object Test3 { object Test { import java.lang.System; - def check_success(name: String, def closure: Int, expected: Int): Unit = { + def check_success(name: String, closure: => Int, expected: Int): Unit = { System.out.print("test " + name); try { val actual: Int = closure; diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala index 6d7647009d..5a0c2e5c53 100644 --- a/test/files/run/literals.scala +++ b/test/files/run/literals.scala @@ -15,7 +15,7 @@ object Test { case class GGG(i:int) { def \u21a1\u21a1( that:GGG ) = that; } - def check_success[a](name: String, def closure: a, expected: a): Unit = { + def check_success[a](name: String, closure: => a, expected: a): Unit = { out.print("test " + name); try { val actual: a = closure; diff --git a/test/files/run/runtime.scala b/test/files/run/runtime.scala index 55b2d9d862..1a7141befa 100644 --- a/test/files/run/runtime.scala +++ b/test/files/run/runtime.scala @@ -92,7 +92,7 @@ object Test1Test { object Test { var errors: Int = 0; - def test(bug: String, def test: Unit): Unit = { + def test(bug: String, test: => Unit): Unit = { System.out.println("<<< bug " + bug); try { test; diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index 1a296023aa..efec951d02 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -190,7 +190,7 @@ class TailCall[S](s: S) { object Test { import java.lang.System; - def check_success(name: String, def closure: Int, expected: Int): Unit = { + def check_success(name: String, closure: => Int, expected: Int): Unit = { System.out.print("test " + name); try { val actual: Int = closure; |