diff options
author | Martin Odersky <odersky@gmail.com> | 2003-03-18 11:29:41 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-03-18 11:29:41 +0000 |
commit | 3307717e4e7dc1faf45accd775e5947db3652cd7 (patch) | |
tree | c03b053315c0b62aeb32d1f1a01c638e306905ff | |
parent | 31b5dceeb144c7aa99aa153e4184cbb3b45110e0 (diff) | |
download | scala-3307717e4e7dc1faf45accd775e5947db3652cd7.tar.gz scala-3307717e4e7dc1faf45accd775e5947db3652cd7.tar.bz2 scala-3307717e4e7dc1faf45accd775e5947db3652cd7.zip |
*** empty log message ***
-rw-r--r-- | sources/scala/$colon$colon.scala | 4 | ||||
-rw-r--r-- | sources/scala/Iterator.scala | 2 | ||||
-rw-r--r-- | sources/scala/Nil.scala | 4 | ||||
-rw-r--r-- | test/files/pos/A.scala | 2 | ||||
-rw-r--r-- | test/files/pos/List1.scala | 2 | ||||
-rw-r--r-- | test/files/pos/clsrefine.scala | 8 | ||||
-rw-r--r-- | test/files/pos/michel1.scala | 2 | ||||
-rw-r--r-- | test/files/pos/michel2.scala | 4 | ||||
-rw-r--r-- | test/files/pos/michel4.scala | 2 | ||||
-rw-r--r-- | test/files/pos/michel5.scala | 2 | ||||
-rw-r--r-- | test/files/pos/stable.scala | 2 | ||||
-rw-r--r-- | test/files/pos/test4.scala | 2 | ||||
-rw-r--r-- | test/files/pos/test4refine.scala | 4 | ||||
-rw-r--r-- | test/files/pos/test5refine.scala | 24 | ||||
-rw-r--r-- | test/files/run/Course-2002-08.scala | 2 | ||||
-rw-r--r-- | test/pos/A.scala | 2 | ||||
-rw-r--r-- | test/pos/List1.scala | 2 | ||||
-rw-r--r-- | test/pos/clsrefine.scala | 8 | ||||
-rw-r--r-- | test/pos/michel1.scala | 2 | ||||
-rw-r--r-- | test/pos/michel2.scala | 4 | ||||
-rw-r--r-- | test/pos/michel4.scala | 2 | ||||
-rw-r--r-- | test/pos/michel5.scala | 2 | ||||
-rw-r--r-- | test/pos/stable.scala | 2 | ||||
-rw-r--r-- | test/pos/test4.scala | 2 | ||||
-rw-r--r-- | test/pos/test4refine.scala | 4 | ||||
-rw-r--r-- | test/pos/test5refine.scala | 24 |
26 files changed, 61 insertions, 59 deletions
diff --git a/sources/scala/$colon$colon.scala b/sources/scala/$colon$colon.scala index 6eabdfda30..61afd1313b 100644 --- a/sources/scala/$colon$colon.scala +++ b/sources/scala/$colon$colon.scala @@ -3,10 +3,10 @@ package scala { /* A non empty list. * */ - final case class ::[b](hd: b, tl: List[b]) extends List[b] with { + final case class ::[b](hd: b, tl: List[b]) extends List[b] { def isEmpty = false; def head = hd; def tail = tl; - override def toString(): String = mkString("List(", ",", ")"); + override def toString(): String = mkString("[", ",", "]"); } } diff --git a/sources/scala/Iterator.scala b/sources/scala/Iterator.scala index 1f2fafc942..9507722e14 100644 --- a/sources/scala/Iterator.scala +++ b/sources/scala/Iterator.scala @@ -37,7 +37,7 @@ trait Iterator[a] { { skip; source.head; } } - def zip[b](that: Iterator[b]) = new Iterator[Pair[a, b]] with { + def zip[b](that: Iterator[b]) = new Iterator[Pair[a, b]] { def hasNext = Iterator.this.hasNext && that.hasNext; def next = Pair(Iterator.this.next, that.next); } diff --git a/sources/scala/Nil.scala b/sources/scala/Nil.scala index 4f835dbd66..0cc1660f02 100644 --- a/sources/scala/Nil.scala +++ b/sources/scala/Nil.scala @@ -3,11 +3,11 @@ package scala { /* An empty list. Scala provides <code>[]</code> as syntactic sugar * for <code>Nil</code>. */ - final case class Nil[c]() extends List[c] with { + final case class Nil[c]() extends List[c] { def isEmpty = True; def head: c = error("head of empty list"); def tail: List[c] = error("tail of empty list"); - override def toString(): String = "List()"; + override def toString(): String = "[]"; } } diff --git a/test/files/pos/A.scala b/test/files/pos/A.scala index dd8cabaeb7..2f7c958ae2 100644 --- a/test/files/pos/A.scala +++ b/test/files/pos/A.scala @@ -1,4 +1,4 @@ -trait A extends scala.Object with {} +trait A extends scala.Object {} module test { diff --git a/test/files/pos/List1.scala b/test/files/pos/List1.scala index ea25a5c5d5..a6d4e78f8c 100644 --- a/test/files/pos/List1.scala +++ b/test/files/pos/List1.scala @@ -32,7 +32,7 @@ module lists { class IntList() extends List[Int] { def isEmpty: Boolean = False; def head: Int = 1; - def foo: List[Int] with { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int]; + def foo: List[Int] { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int]; def tail0: List[Int] = foo.prepend(1).prepend(1+1); def tail: List[Int] = Nil[Int].prepend(1).prepend(1+1); } diff --git a/test/files/pos/clsrefine.scala b/test/files/pos/clsrefine.scala index cbef0968e0..12f5aa5246 100644 --- a/test/files/pos/clsrefine.scala +++ b/test/files/pos/clsrefine.scala @@ -16,16 +16,16 @@ trait B extends A { } module test { - val b: B with { type Y = Int } = new B { + val b: B { type Y = Int } = new B { type Y = Int; val y1 = 1, y2 = 1; } - val a: A with { type X1 = Int, X2 = Int } = b; - val a1 = new A with { + val a: A { type X1 = Int, X2 = Int } = b; + val a1 = new A { type X1 = Int, X2 = String; val x1 = 1, x2 = "hello" } - val b1 = new B with { + val b1 = new B { type Y = Any; val y1 = 1, y2 = "hello"; } diff --git a/test/files/pos/michel1.scala b/test/files/pos/michel1.scala index d341abbb87..88ef206ff0 100644 --- a/test/files/pos/michel1.scala +++ b/test/files/pos/michel1.scala @@ -4,6 +4,6 @@ class A[Ta] (a : Ta) { trait C {} -class B[Tb] (b : Tb) extends C with A[Tb] (b) with { +class B[Tb] (b : Tb) extends C with A[Tb] (b) { def g = 2 }
\ No newline at end of file diff --git a/test/files/pos/michel2.scala b/test/files/pos/michel2.scala index 8f3f34e1ba..d5b61dda21 100644 --- a/test/files/pos/michel2.scala +++ b/test/files/pos/michel2.scala @@ -1,7 +1,7 @@ -trait A extends Object with { +trait A extends Object { def f : Int = 1 } -trait B extends Object with A with { +trait B extends Object with A { override def f : Int = super.f }
\ No newline at end of file diff --git a/test/files/pos/michel4.scala b/test/files/pos/michel4.scala index 2eabe61605..2390be5d26 100644 --- a/test/files/pos/michel4.scala +++ b/test/files/pos/michel4.scala @@ -2,6 +2,6 @@ class A() { val f : Int = 2 } -class B() extends A() with { +class B() extends A() { override val f : Int = super.f }
\ No newline at end of file diff --git a/test/files/pos/michel5.scala b/test/files/pos/michel5.scala index 2045737fc4..345ae04d9d 100644 --- a/test/files/pos/michel5.scala +++ b/test/files/pos/michel5.scala @@ -1,5 +1,5 @@ trait A[Ta] { } -class B() extends Object with A[Int] with { +class B() extends Object with A[Int] { val x : Int = 2 }
\ No newline at end of file diff --git a/test/files/pos/stable.scala b/test/files/pos/stable.scala index 3bbcad3799..2ae6e2dcec 100644 --- a/test/files/pos/stable.scala +++ b/test/files/pos/stable.scala @@ -4,7 +4,7 @@ trait Base { var z: Int; } -class Sub() extends Base with { +class Sub() extends Base { override val x: Int = 1; override val y: Int = 2; override var z: Int = 3; diff --git a/test/files/pos/test4.scala b/test/files/pos/test4.scala index c71b65a283..0bbb6f97a0 100644 --- a/test/files/pos/test4.scala +++ b/test/files/pos/test4.scala @@ -10,7 +10,7 @@ module test { import test._; -trait S extends o.I[D] with { +trait S extends o.I[D] { def bar: E = foo(c,d); } diff --git a/test/files/pos/test4refine.scala b/test/files/pos/test4refine.scala index 8e3fee70cc..ad68bc891a 100644 --- a/test/files/pos/test4refine.scala +++ b/test/files/pos/test4refine.scala @@ -21,8 +21,8 @@ abstract class O() { type Y; def foo(x: X, y: Y): E = e; } - val i:I with { type Y = E } = null; - val j:I with { type Y = X } = null; + val i:I { type Y = E } = null; + val j:I { type Y = X } = null; } module o extends O() { diff --git a/test/files/pos/test5refine.scala b/test/files/pos/test5refine.scala index a9d7a02bf6..7efbf5a3f1 100644 --- a/test/files/pos/test5refine.scala +++ b/test/files/pos/test5refine.scala @@ -4,11 +4,11 @@ module test { abstract trait F { type If; } - def f[Jf](h: Jf):F with { type If = Jf } = f[Jf](h); + def f[Jf](h: Jf):F { type If = Jf } = f[Jf](h); abstract trait G { type Ig; } - def g[Jg](h: Jg):G with { type Ig = Jg } = g[Jg](h); + def g[Jg](h: Jg):G { type Ig = Jg } = g[Jg](h); abstract class M() { type P; @@ -23,24 +23,24 @@ module test { def val_ix: X = val_ix; } - val i: I with { type X = G with { type Ig = P } } = null; + val i: I { type X = G { type Ig = P } } = null; // Values with types P and i.X as seen from instances of M def val_mp: P = val_mp; - def val_mix: G with { type Ig = P } = g[P](val_mp); + def val_mix: G { type Ig = P } = g[P](val_mp); } abstract class N() extends M() { type Q; - type P = F with { type If = Q }; - val j:J with { type Y = G with { type Ig = Q } } = null; + type P = F { type If = Q }; + val j:J { type Y = G { type Ig = Q } } = null; abstract class J() extends I() { type Y; - type X = G with { type Ig = Y; }; + type X = G { type Ig = Y; }; // Values with types Y and X as seen from instances of J def val_jy: Y = val_jy; - def val_jx: G with { type Ig = Y; } = g[Y](val_jy); + def val_jx: G { type Ig = Y; } = g[Y](val_jy); // Check type P chk_ip(val_mp); @@ -49,10 +49,10 @@ module test { // Values with types Q, X.P, i.X, j.Y and j.X as seen from instances of N def val_nq: Q = val_nq; - def val_np: F with { type If = Q } = f[Q](val_nq); - def val_nix: G with { type Ig = F with { type If = Q } } = g[F with { type If = Q }](val_np); - def val_njy: G with { type Ig = Q; } = g[Q](val_nq); - def val_njx: G with { type Ig = G with { type Ig = Q }} = g[G with { type Ig = Q; }](val_njy); + def val_np: F { type If = Q } = f[Q](val_nq); + def val_nix: G { type Ig = F { type If = Q } } = g[F { type If = Q }](val_np); + def val_njy: G { type Ig = Q; } = g[Q](val_nq); + def val_njx: G { type Ig = G { type Ig = Q }} = g[G { type Ig = Q; }](val_njy); // Check type i.P i.chk_ip(val_mp); diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala index 84f3bb02ac..c1589d3bf5 100644 --- a/test/files/run/Course-2002-08.scala +++ b/test/files/run/Course-2002-08.scala @@ -3,6 +3,8 @@ //############################################################################ // $Id$ +import List._; + module M0 { var x: String = "abc"; diff --git a/test/pos/A.scala b/test/pos/A.scala index dd8cabaeb7..2f7c958ae2 100644 --- a/test/pos/A.scala +++ b/test/pos/A.scala @@ -1,4 +1,4 @@ -trait A extends scala.Object with {} +trait A extends scala.Object {} module test { diff --git a/test/pos/List1.scala b/test/pos/List1.scala index ea25a5c5d5..a6d4e78f8c 100644 --- a/test/pos/List1.scala +++ b/test/pos/List1.scala @@ -32,7 +32,7 @@ module lists { class IntList() extends List[Int] { def isEmpty: Boolean = False; def head: Int = 1; - def foo: List[Int] with { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int]; + def foo: List[Int] { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int]; def tail0: List[Int] = foo.prepend(1).prepend(1+1); def tail: List[Int] = Nil[Int].prepend(1).prepend(1+1); } diff --git a/test/pos/clsrefine.scala b/test/pos/clsrefine.scala index cbef0968e0..12f5aa5246 100644 --- a/test/pos/clsrefine.scala +++ b/test/pos/clsrefine.scala @@ -16,16 +16,16 @@ trait B extends A { } module test { - val b: B with { type Y = Int } = new B { + val b: B { type Y = Int } = new B { type Y = Int; val y1 = 1, y2 = 1; } - val a: A with { type X1 = Int, X2 = Int } = b; - val a1 = new A with { + val a: A { type X1 = Int, X2 = Int } = b; + val a1 = new A { type X1 = Int, X2 = String; val x1 = 1, x2 = "hello" } - val b1 = new B with { + val b1 = new B { type Y = Any; val y1 = 1, y2 = "hello"; } diff --git a/test/pos/michel1.scala b/test/pos/michel1.scala index d341abbb87..88ef206ff0 100644 --- a/test/pos/michel1.scala +++ b/test/pos/michel1.scala @@ -4,6 +4,6 @@ class A[Ta] (a : Ta) { trait C {} -class B[Tb] (b : Tb) extends C with A[Tb] (b) with { +class B[Tb] (b : Tb) extends C with A[Tb] (b) { def g = 2 }
\ No newline at end of file diff --git a/test/pos/michel2.scala b/test/pos/michel2.scala index 8f3f34e1ba..d5b61dda21 100644 --- a/test/pos/michel2.scala +++ b/test/pos/michel2.scala @@ -1,7 +1,7 @@ -trait A extends Object with { +trait A extends Object { def f : Int = 1 } -trait B extends Object with A with { +trait B extends Object with A { override def f : Int = super.f }
\ No newline at end of file diff --git a/test/pos/michel4.scala b/test/pos/michel4.scala index 2eabe61605..2390be5d26 100644 --- a/test/pos/michel4.scala +++ b/test/pos/michel4.scala @@ -2,6 +2,6 @@ class A() { val f : Int = 2 } -class B() extends A() with { +class B() extends A() { override val f : Int = super.f }
\ No newline at end of file diff --git a/test/pos/michel5.scala b/test/pos/michel5.scala index 2045737fc4..345ae04d9d 100644 --- a/test/pos/michel5.scala +++ b/test/pos/michel5.scala @@ -1,5 +1,5 @@ trait A[Ta] { } -class B() extends Object with A[Int] with { +class B() extends Object with A[Int] { val x : Int = 2 }
\ No newline at end of file diff --git a/test/pos/stable.scala b/test/pos/stable.scala index 3bbcad3799..2ae6e2dcec 100644 --- a/test/pos/stable.scala +++ b/test/pos/stable.scala @@ -4,7 +4,7 @@ trait Base { var z: Int; } -class Sub() extends Base with { +class Sub() extends Base { override val x: Int = 1; override val y: Int = 2; override var z: Int = 3; diff --git a/test/pos/test4.scala b/test/pos/test4.scala index c71b65a283..0bbb6f97a0 100644 --- a/test/pos/test4.scala +++ b/test/pos/test4.scala @@ -10,7 +10,7 @@ module test { import test._; -trait S extends o.I[D] with { +trait S extends o.I[D] { def bar: E = foo(c,d); } diff --git a/test/pos/test4refine.scala b/test/pos/test4refine.scala index 8e3fee70cc..ad68bc891a 100644 --- a/test/pos/test4refine.scala +++ b/test/pos/test4refine.scala @@ -21,8 +21,8 @@ abstract class O() { type Y; def foo(x: X, y: Y): E = e; } - val i:I with { type Y = E } = null; - val j:I with { type Y = X } = null; + val i:I { type Y = E } = null; + val j:I { type Y = X } = null; } module o extends O() { diff --git a/test/pos/test5refine.scala b/test/pos/test5refine.scala index a9d7a02bf6..7efbf5a3f1 100644 --- a/test/pos/test5refine.scala +++ b/test/pos/test5refine.scala @@ -4,11 +4,11 @@ module test { abstract trait F { type If; } - def f[Jf](h: Jf):F with { type If = Jf } = f[Jf](h); + def f[Jf](h: Jf):F { type If = Jf } = f[Jf](h); abstract trait G { type Ig; } - def g[Jg](h: Jg):G with { type Ig = Jg } = g[Jg](h); + def g[Jg](h: Jg):G { type Ig = Jg } = g[Jg](h); abstract class M() { type P; @@ -23,24 +23,24 @@ module test { def val_ix: X = val_ix; } - val i: I with { type X = G with { type Ig = P } } = null; + val i: I { type X = G { type Ig = P } } = null; // Values with types P and i.X as seen from instances of M def val_mp: P = val_mp; - def val_mix: G with { type Ig = P } = g[P](val_mp); + def val_mix: G { type Ig = P } = g[P](val_mp); } abstract class N() extends M() { type Q; - type P = F with { type If = Q }; - val j:J with { type Y = G with { type Ig = Q } } = null; + type P = F { type If = Q }; + val j:J { type Y = G { type Ig = Q } } = null; abstract class J() extends I() { type Y; - type X = G with { type Ig = Y; }; + type X = G { type Ig = Y; }; // Values with types Y and X as seen from instances of J def val_jy: Y = val_jy; - def val_jx: G with { type Ig = Y; } = g[Y](val_jy); + def val_jx: G { type Ig = Y; } = g[Y](val_jy); // Check type P chk_ip(val_mp); @@ -49,10 +49,10 @@ module test { // Values with types Q, X.P, i.X, j.Y and j.X as seen from instances of N def val_nq: Q = val_nq; - def val_np: F with { type If = Q } = f[Q](val_nq); - def val_nix: G with { type Ig = F with { type If = Q } } = g[F with { type If = Q }](val_np); - def val_njy: G with { type Ig = Q; } = g[Q](val_nq); - def val_njx: G with { type Ig = G with { type Ig = Q }} = g[G with { type Ig = Q; }](val_njy); + def val_np: F { type If = Q } = f[Q](val_nq); + def val_nix: G { type Ig = F { type If = Q } } = g[F { type If = Q }](val_np); + def val_njy: G { type Ig = Q; } = g[Q](val_nq); + def val_njx: G { type Ig = G { type Ig = Q }} = g[G { type Ig = Q; }](val_njy); // Check type i.P i.chk_ip(val_mp); |