summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-04 15:17:55 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-04 15:17:55 +0000
commit9370a1e00177d77624f68983ec6009b468a4337b (patch)
treeca78d69eb772a3826577717a607280839f5cd7d6
parent082d612f19cf3e78f76337da6ff496ef5c96fd28 (diff)
downloadscala-9370a1e00177d77624f68983ec6009b468a4337b.tar.gz
scala-9370a1e00177d77624f68983ec6009b468a4337b.tar.bz2
scala-9370a1e00177d77624f68983ec6009b468a4337b.zip
- Fixed for flattened value types
-rw-r--r--test/files/pos/valdefs.scala4
-rw-r--r--test/files/run/Course-2002-02.scala4
-rw-r--r--test/files/run/Course-2002-09.scala4
-rw-r--r--test/files/run/arrays.scala24
-rw-r--r--test/pos/valdefs.scala4
5 files changed, 20 insertions, 20 deletions
diff --git a/test/files/pos/valdefs.scala b/test/files/pos/valdefs.scala
index 6e91b020b5..85ffa132b7 100644
--- a/test/files/pos/valdefs.scala
+++ b/test/files/pos/valdefs.scala
@@ -7,10 +7,10 @@ object test {
case class Sub() extends Base() {
val x = "hello";
- override val y = 1;
+ override val y = 2.0;
}
abstract class Sub2() extends Base() {
- override val Pair(x, y) = Pair("abc", 1);
+ override val Pair(x, y) = Pair("abc", 2.0);
}
}
diff --git a/test/files/run/Course-2002-02.scala b/test/files/run/Course-2002-02.scala
index fc9add8371..3aee36d042 100644
--- a/test/files/run/Course-2002-02.scala
+++ b/test/files/run/Course-2002-02.scala
@@ -206,9 +206,9 @@ object M9 {
def inc(x: Int) = x + 1;
def sum(f: Int => Double) =
- accumulate((x: Double, y: Double) => x + y, 0, f, inc);
+ accumulate((x: Double, y: Double) => x + y, 0d, f, inc);
def product(f: Int => Double) =
- accumulate((x: Double, y: Double) => x * y, 1, f, inc);
+ accumulate((x: Double, y: Double) => x * y, 1d, f, inc);
def sumInts = sum(x => x);
def sumCubes = sum(x => x * x * x);
diff --git a/test/files/run/Course-2002-09.scala b/test/files/run/Course-2002-09.scala
index b984fbf9d2..6468b012a5 100644
--- a/test/files/run/Course-2002-09.scala
+++ b/test/files/run/Course-2002-09.scala
@@ -35,8 +35,8 @@ class Adder(a1: Quantity,a2: Quantity,sum: Quantity) extends Constraint {
class Multiplier(m1: Quantity, m2: Quantity, prod: Quantity)
extends Constraint {
def newValue = Triple(m1.getValue, m2.getValue, prod.getValue) match {
- case Triple(Some( 0), _ , _ ) => prod.setValue(0, this);
- case Triple(_ , Some( 0), _ ) => prod.setValue(0, this);
+ case Triple(Some(0d), _ , _ ) => prod.setValue(0, this);
+ case Triple(_ , Some(0d), _ ) => prod.setValue(0, this);
case Triple(Some(x1), Some(x2), _ ) => prod.setValue(x1 * x2, this)
case Triple(Some(x1), _ , Some(r)) => m2.setValue(r / x1, this)
case Triple(_, Some(x2), Some(r)) => m1.setValue(r / x2, this)
diff --git a/test/files/run/arrays.scala b/test/files/run/arrays.scala
index 1100366392..048e067b2b 100644
--- a/test/files/run/arrays.scala
+++ b/test/files/run/arrays.scala
@@ -78,9 +78,9 @@ object arrays {
check("sarray(0)", sarray(0), 0);
check("carray(0)", carray(0), 0);
check("iarray(0)", iarray(0), 0);
- check("larray(0)", larray(0), 0);
- check("farray(0)", farray(0), 0);
- check("darray(0)", darray(0), 0);
+ check("larray(0)", larray(0), 0l);
+ check("farray(0)", farray(0), 0f);
+ check("darray(0)", darray(0), 0d);
check("rarray(0)", rarray(0), null);
System.out.println();
@@ -89,9 +89,9 @@ object arrays {
check("sarray(1)", sarray(1), 0);
check("carray(1)", carray(1), 0);
check("iarray(1)", iarray(1), 0);
- check("larray(1)", larray(1), 0);
- check("farray(1)", farray(1), 0);
- check("darray(1)", darray(1), 0);
+ check("larray(1)", larray(1), 0l);
+ check("farray(1)", farray(1), 0f);
+ check("darray(1)", darray(1), 0d);
check("rarray(1)", rarray(1), null);
System.out.println();
@@ -120,9 +120,9 @@ object arrays {
check("sarray(0)", sarray(0), 2);
check("carray(0)", carray(0),'3');
check("iarray(0)", iarray(0), 4);
- check("larray(0)", larray(0), 5);
- check("farray(0)", farray(0), 6);
- check("darray(0)", darray(0), 7);
+ check("larray(0)", larray(0), 5l);
+ check("farray(0)", farray(0), 6f);
+ check("darray(0)", darray(0), 7d);
check("rarray(0)", rarray(0),"8");
System.out.println();
@@ -131,9 +131,9 @@ object arrays {
check("sarray(1)", sarray(1), 3);
check("carray(1)", carray(1),'4');
check("iarray(1)", iarray(1), 5);
- check("larray(1)", larray(1), 6);
- check("farray(1)", farray(1), 7);
- check("darray(1)", darray(1), 8);
+ check("larray(1)", larray(1), 6l);
+ check("farray(1)", farray(1), 7f);
+ check("darray(1)", darray(1), 8d);
check("rarray(1)", rarray(1),"9");
System.out.println();
diff --git a/test/pos/valdefs.scala b/test/pos/valdefs.scala
index 6e91b020b5..85ffa132b7 100644
--- a/test/pos/valdefs.scala
+++ b/test/pos/valdefs.scala
@@ -7,10 +7,10 @@ object test {
case class Sub() extends Base() {
val x = "hello";
- override val y = 1;
+ override val y = 2.0;
}
abstract class Sub2() extends Base() {
- override val Pair(x, y) = Pair("abc", 1);
+ override val Pair(x, y) = Pair("abc", 2.0);
}
}