diff options
Diffstat (limited to 'test/pos')
127 files changed, 0 insertions, 2179 deletions
diff --git a/test/pos/A.scala b/test/pos/A.scala deleted file mode 100644 index fc50379d88..0000000000 --- a/test/pos/A.scala +++ /dev/null @@ -1,8 +0,0 @@ -trait A extends java.lang.Object {} - -object test { - - def x: A = x; - -} - diff --git a/test/pos/List1.scala b/test/pos/List1.scala deleted file mode 100644 index f0fce9501f..0000000000 --- a/test/pos/List1.scala +++ /dev/null @@ -1,45 +0,0 @@ -object lists { - - trait List[a] { - def isEmpty: Boolean; - def head: a; - def tail: List[a]; - def prepend(x: a) = Cons[a](x, this); - } - - def Nil[a] = new List[a] { - def isEmpty: Boolean = true; - def head = error("head of Nil"); - def tail = error("tail of Nil"); - } - - def Cons[a](x: a, xs: List[a]): List[a] = new List[a] { - def isEmpty = false; - def head = x; - def tail = xs; - } - - def foo = { - val intnil = Nil[Int]; - val intlist = intnil.prepend(1).prepend(1+1); - val x: Int = intlist.head; - val strnil = Nil[String]; - val strlist = strnil.prepend("A").prepend("AA"); - val y: String = strlist.head; - () - } - - class IntList() extends List[Int] { - def isEmpty: Boolean = false; - def head: Int = 1; - 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); - } - - def foo2 = { - val il1 = new IntList(); - val il2 = il1.prepend(1).prepend(2); - () - } -} diff --git a/test/pos/MailBox.scala b/test/pos/MailBox.scala deleted file mode 100644 index 3a633e3fbe..0000000000 --- a/test/pos/MailBox.scala +++ /dev/null @@ -1,80 +0,0 @@ -package test; - -import scala.concurrent._; - -class MailBox { - private class LinkedList[a] { - var elem: a = _; - var next: LinkedList[a] = null; - } - - def insert[a](l: LinkedList[a], x: a): LinkedList[a] = { - l.next = new LinkedList[a]; - l.next.elem = x; - l.next.next = l.next; - l - } - - private abstract class Receiver { - def isDefined(msg: Any): boolean; - var msg: Any = null; - } - - private val sent = new LinkedList[Any]; - private var lastSent = sent; - private val receivers = new LinkedList[Receiver]; - private var lastReceiver = receivers; - - def send(msg: Any): unit = synchronized { - var r = receivers, r1 = r.next; - while (r1 != null && !r1.elem.isDefined(msg)) { - r = r1; r1 = r1.next; - } - if (r1 != null) { - r.next = r1.next; r1.elem.msg = msg; r1.elem.notify; - } else { - lastSent = insert(lastSent, msg); - } - } - - def receive[a](f: PartialFunction[Any, a]): a = { - val msg: Any = synchronized { - var s = sent, s1 = s.next; - while (s1 != null && !f.isDefinedAt(s1.elem)) { - s = s1; s1 = s1.next - } - if (s1 != null) { - s.next = s1.next; s1.elem - } else { - val r = insert(lastReceiver, new Receiver { - def isDefined(msg: Any) = f.isDefinedAt(msg); - }); - lastReceiver = r; - r.elem.wait(); - r.elem.msg - } - } - f(msg) - } - - def receiveWithin[a](msec: long)(f: PartialFunction[Any, a]): a = { - val msg: Any = synchronized { - var s = sent, s1 = s.next; - while (s1 != null && !f.isDefinedAt(s1.elem)) { - s = s1; s1 = s1.next ; - } - if (s1 != null) { - s.next = s1.next; s1.elem - } else { - val r = insert(lastReceiver, new Receiver { - def isDefined(msg: Any) = f.isDefinedAt(msg); - }); - lastReceiver = r; - r.elem.wait(msec); - if (r.elem.msg == null) r.elem.msg = TIMEOUT; - r.elem.msg - } - } - f(msg) - } -} diff --git a/test/pos/S1.scala b/test/pos/S1.scala deleted file mode 100644 index 68706e3dd3..0000000000 --- a/test/pos/S1.scala +++ /dev/null @@ -1,13 +0,0 @@ -/* This is probably no bug, I just don't understand why -** type inference does not find the right instantiation of foo. -** Currently it reports: -** -** S1.scala:12: inferred type arguments [S1] do not conform to -** method foo's type parameter bounds [T <: S1.this.type] -** foo(this); -** ^ -*/ -class S1() { - def foo[T <: this.type](x: T) = x; - foo[this.type](this); -} diff --git a/test/pos/S3.scala b/test/pos/S3.scala deleted file mode 100644 index 1e0f0288b1..0000000000 --- a/test/pos/S3.scala +++ /dev/null @@ -1,14 +0,0 @@ -/* Why does this code fail? b has type a.type, so the third -** declaration in S3 should be okay... The compiler writes instead: -** -** found : S3.this.b.type (with underlying type S3) -** required: S3.this.a.type -** val c: a.type = b; -** ^ -** Without declaration 3, everything is fine. -*/ -class S3() { - val a = new S3(); - val b: a.type = a; - val c: a.type = b; -} diff --git a/test/pos/S5.scala b/test/pos/S5.scala deleted file mode 100644 index 08f5b2a6eb..0000000000 --- a/test/pos/S5.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* Here's a fragment of a Scala encoding for the Keris module system; -** the compiler claims: -** -** S5.scala:28: value n in class N of type N.this._N.n -** cannot override value n in class M of type M.this._N.n -** val system = new M() with N() {} -** ^ -** To me it seems like the code is perfectly fine... -*/ -abstract class M() { - val _N: N; - val n: _N.n; - val _M: M = this; - val m: _M.m = new _M.m(); - class m() { - // module body of M - } -} -abstract class N() { - val _N: N = this; - val n: _N.n = new _N.n(); - val _M: M; - val m: _M.m; - class n() { - // module body of N - } -} -object O { - val system = new M() with N() {} -} diff --git a/test/pos/S8.scala b/test/pos/S8.scala deleted file mode 100644 index 50f1df27a2..0000000000 --- a/test/pos/S8.scala +++ /dev/null @@ -1,19 +0,0 @@ -/* I believe this code is correct, but the compiler rejects it: -** -** S8.scala:18: type mismatch; -** found : M.x.A -** required: M.x.a.B -** val y: x.a.B = new x.A(); //correct? -** ^ -** For a given value x of type S8, type x.A should be -** a subtype of x.a.B. -*/ -class S8() { - val a: S8 = this; - class A() extends a.B() {} - class B() {} -} -object M { - val x = new S8(); - val y: x.a.B = new x.A(); //correct? -} diff --git a/test/pos/X.scala b/test/pos/X.scala deleted file mode 100644 index 2edf010efd..0000000000 --- a/test/pos/X.scala +++ /dev/null @@ -1,14 +0,0 @@ -abstract class A() { - - var x: Int - -} - -abstract class B() extends A() { - - var xx: Int = 0; - - def x = xx; - def x_=(y: Int) = xx = y; -} - diff --git a/test/pos/Y.scala b/test/pos/Y.scala deleted file mode 100644 index fd235e735d..0000000000 --- a/test/pos/Y.scala +++ /dev/null @@ -1,7 +0,0 @@ -object test { - - def f(x: Object): java.lang.Object /* !!! Object */ = x.match; - -} - - diff --git a/test/pos/Z.scala b/test/pos/Z.scala deleted file mode 100644 index c1367e46b9..0000000000 --- a/test/pos/Z.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait X { - val elem: Int = 1 -} - -object test { - - def g(x: X) = x.elem; - def f(x: Object) = x.toString(); - -} diff --git a/test/pos/abstract-data.scala b/test/pos/abstract-data.scala deleted file mode 100644 index eaa23b6834..0000000000 --- a/test/pos/abstract-data.scala +++ /dev/null @@ -1,55 +0,0 @@ -package expAbstractData; - -/** A base class consisting of - * - a root trait (i.e. abstract class) `Exp' with an `eval' function - * - an abstract type `exp' bounded by `Exp' - * - a concrete instance class `Num' of `Exp' for numeric literals - */ -trait Base { - type exp <: Exp; - - trait Exp { - def eval: int - } - class Num(v: int): exp extends Exp { - val value = v; - def eval = value - } -} - -object testBase extends Base with Application { - type exp = Exp; - val term = new Num(2); - System.out.println(term.eval); -} - -/** Data extension: An extension of `Base' with `Plus' expressions - */ -trait BasePlus extends Base { - class Plus(l: exp, r: exp): exp extends Exp { - val left = l; - val right = r; - def eval = left.eval + right.eval - } -} - -/** Operation extension: An extension of `Base' with 'show' methods. - */ -trait Show extends Base { - type exp <: Exp1; - - trait Exp1 extends Exp { - def show: String; - } - class Num1(v: int): exp extends Num(v) with Exp1 { - def show = value.toString(); - } -} - -/** Operation extension: An extension of `BasePlus' with 'show' methods. - */ -trait ShowPlus extends BasePlus with Show { - class Plus1(l: exp, r: exp): exp extends Plus(l, r) with Exp1 { - def show = left.show + " + " + right.show - } -}
\ No newline at end of file diff --git a/test/pos/abstract.scala b/test/pos/abstract.scala deleted file mode 100644 index f51ae63e6b..0000000000 --- a/test/pos/abstract.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait C { - type t; - def copy(x: t): t = x; -} - -class D() extends C { - type t = Int; - System.out.println(copy(1)); -} diff --git a/test/pos/aliases.scala b/test/pos/aliases.scala deleted file mode 100644 index b746a35861..0000000000 --- a/test/pos/aliases.scala +++ /dev/null @@ -1,25 +0,0 @@ -abstract class C() { - - type t <: C; - - val x: t; - val y: x.type; - val z: x.type; - val u: z.type; - - val xt: x.t; - val yt: y.t; - val zt: z.t; - val ut: z.t; - - def fx(a: x.t): Unit; - def fy(a: y.t): Unit; - def fz(a: z.t): Unit; - def fu(a: u.t): Unit; - - fx(xt); fx(yt); fx(zt); fx(ut); - fy(xt); fy(yt); fy(zt); fy(ut); - fz(xt); fz(yt); fz(zt); fz(ut); - fu(xt); fu(yt); fu(zt); fu(ut); - -} diff --git a/test/pos/arrays2.scala b/test/pos/arrays2.scala deleted file mode 100644 index 26adaf63ca..0000000000 --- a/test/pos/arrays2.scala +++ /dev/null @@ -1,11 +0,0 @@ -case class C(); - -object arrays2 { - - def main(args: Array[String]): unit = { - val a = new Array[Array[C]](2); - a(0) = new Array[C](2); - a(0)(0) = new C(); - } -} - diff --git a/test/pos/bug082.scala b/test/pos/bug082.scala deleted file mode 100644 index 594c9fdc86..0000000000 --- a/test/pos/bug082.scala +++ /dev/null @@ -1,18 +0,0 @@ - -object Main { - - def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = xs match { - case List() => None - case List(x) => Some(x) -// case x :: Nil => Some(x) - case y :: ys => min0(less, ys) match { - case Some(m) => if (less(y, m)) Some(y) else Some(m) - } - } - - def min(xs: List[Int]) = min0((x: Int, y: Int) => x < y, xs); - - def main(args: Array[String]) = - System.out.println(min(List())); - -} diff --git a/test/pos/bug1.scala b/test/pos/bug1.scala deleted file mode 100644 index bdf33ef20d..0000000000 --- a/test/pos/bug1.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Exceptions { - - class CubeException(s: String) extends java.lang.RuntimeException(s); - - def main(args: Array[String]) = - System.out.println(new CubeException("test")); - -} diff --git a/test/pos/bug115.scala b/test/pos/bug115.scala deleted file mode 100644 index 87a5c10915..0000000000 --- a/test/pos/bug115.scala +++ /dev/null @@ -1,8 +0,0 @@ -class S[A](f: A => A, x: A) { - System.out.println(f(x)); -} -class T[A](f: A => A, y: A) extends S(x: A => f(x), y) { -} -object Test with Application { - new T[int](x: int => x * 2, 1); -} diff --git a/test/pos/bug116.scala b/test/pos/bug116.scala deleted file mode 100644 index b02c81f0b7..0000000000 --- a/test/pos/bug116.scala +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -class C { - def this(x: Int) = { - this(); - class D extends C; - } -} diff --git a/test/pos/bug119.scala b/test/pos/bug119.scala deleted file mode 100644 index e3f0993862..0000000000 --- a/test/pos/bug119.scala +++ /dev/null @@ -1,7 +0,0 @@ -class K[E] { - case class A(v:E){}; -} - -class K2 extends K[int] { - val A(v) = A(42); -} diff --git a/test/pos/bug121.scala b/test/pos/bug121.scala deleted file mode 100644 index 78ddc41ee5..0000000000 --- a/test/pos/bug121.scala +++ /dev/null @@ -1,3 +0,0 @@ -class Bug121_B(b: Array[Byte]) { - def get(x: Int): Byte = return b(x); -} diff --git a/test/pos/bug123.scala b/test/pos/bug123.scala deleted file mode 100644 index 79f0c907a3..0000000000 --- a/test/pos/bug123.scala +++ /dev/null @@ -1,3 +0,0 @@ -class M{ - val 1 = 1; -} diff --git a/test/pos/bug124.scala b/test/pos/bug124.scala deleted file mode 100644 index 9aed6786f6..0000000000 --- a/test/pos/bug124.scala +++ /dev/null @@ -1,5 +0,0 @@ -class N{ - val F: Any => Any = (x:Any) => F(x); - val f:(Any => Any) = (x:Any) => f(x); - val g: Any => Any = (x:Any) => g(x); -} diff --git a/test/pos/bug151.scala b/test/pos/bug151.scala deleted file mode 100644 index 86667b49f7..0000000000 --- a/test/pos/bug151.scala +++ /dev/null @@ -1,6 +0,0 @@ -abstract class Foo { - type T; - def foo(a: T): Int = 0; - val foo: Foo = null; - def a: foo.T = a; -} diff --git a/test/pos/bug159.scala b/test/pos/bug159.scala deleted file mode 100644 index d6cdb97b47..0000000000 --- a/test/pos/bug159.scala +++ /dev/null @@ -1,22 +0,0 @@ -object foo { - - // the problem seems to appear only - // if "val _" is in the body of a case - def cooked( ckd:StringBuffer ):Unit = - 'a'.match { - case '-' => - val _ = ckd.append( '_' ); - case 'v' => - val _ = ckd.append( '_' ); - } - -} -object foo1 { - def f():Unit = { - 1.match { - case 2 => val _ = 1; - case 3 => val _ = 2; - case 4 => val _ = 2; - } - } -} diff --git a/test/pos/bug160.scala b/test/pos/bug160.scala deleted file mode 100644 index f1c36ebeae..0000000000 --- a/test/pos/bug160.scala +++ /dev/null @@ -1,5 +0,0 @@ -// $Id$ - -class Foo(s:String) { - def this() = { this("DEFAULT") } -} diff --git a/test/pos/bug17.scala b/test/pos/bug17.scala deleted file mode 100644 index a83eefe972..0000000000 --- a/test/pos/bug17.scala +++ /dev/null @@ -1,21 +0,0 @@ -class Quantity { - def getValue = 0; - def connect(c: Constraint) = c.newValue; -} - -abstract class Constraint(q: Quantity) { - def newValue: Unit; - q connect this -} - -class Adder(q: Quantity) extends Constraint(q) { - def newValue = System.out.println(q.getValue); -} - -object Main { - def main(args: Array[String]): Unit = { - val x = new Quantity; - new Adder(x); - () - } -} diff --git a/test/pos/bug175.scala b/test/pos/bug175.scala deleted file mode 100644 index 2ef26589c2..0000000000 --- a/test/pos/bug175.scala +++ /dev/null @@ -1,5 +0,0 @@ -// $Id$ - -abstract class C { - def this(x: Unit) = { this() } -} diff --git a/test/pos/bug177.scala b/test/pos/bug177.scala deleted file mode 100644 index 9bd913f179..0000000000 --- a/test/pos/bug177.scala +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ - -class A { - def foo = { - object Y { - def bar = 1; - } - Y.bar - } -} diff --git a/test/pos/bug183.scala b/test/pos/bug183.scala deleted file mode 100644 index 4804eb3828..0000000000 --- a/test/pos/bug183.scala +++ /dev/null @@ -1,6 +0,0 @@ -// $Id$ - -object Test { - new Foo(0); - class Foo(x: Int); -} diff --git a/test/pos/bug193.scala b/test/pos/bug193.scala deleted file mode 100644 index 9b1c82f45f..0000000000 --- a/test/pos/bug193.scala +++ /dev/null @@ -1,74 +0,0 @@ -// $Id$ - -trait Test { - - def fun_00(x: Int): Unit = { - (0: Any) == 0; - (0 ) == 0; - (0: Any) != 0; - (0 ) != 0; - () - } - - def fun_i0(x: Int): Unit = { - (x: Any) == 0; - (x ) == 0; - (x: Any) != 0; - (x ) != 0; - () - } - - def fun_o0(x: Object): Unit = { - (x: Any) == 0; - (x ) == 0; - (x: Any) != 0; - (x ) != 0; - () - } - - def fun_0i(y: Int): Unit = { - (0: Any) == y; - (0 ) == y; - (0: Any) != y; - (0 ) != y; - () - } - - def fun_0o(y: Object): Unit = { - (0: Any) == y; - (0 ) == y; - (0: Any) != y; - (0 ) != y; - () - } - - def fun_ii(x: Int, y: Int): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_io(x: Int, y: Object): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_oi(x: Object, y: Int): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - def fun_oo(x: Object, y: Object): Unit = { - (x: Any) == y; - (x ) == y; - (x: Any) != y; - (x ) != y; - () - } - -} diff --git a/test/pos/bug2.scala b/test/pos/bug2.scala deleted file mode 100644 index 4c58ed3f4f..0000000000 --- a/test/pos/bug2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object main { - def main(args: Array[String]) = { - val b = true; - while (b == true) { } - } -} diff --git a/test/pos/bug20.scala b/test/pos/bug20.scala deleted file mode 100644 index bdf33ef20d..0000000000 --- a/test/pos/bug20.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Exceptions { - - class CubeException(s: String) extends java.lang.RuntimeException(s); - - def main(args: Array[String]) = - System.out.println(new CubeException("test")); - -} diff --git a/test/pos/bug201.scala b/test/pos/bug201.scala deleted file mode 100644 index 53dac21ef0..0000000000 --- a/test/pos/bug201.scala +++ /dev/null @@ -1,7 +0,0 @@ -class C[a] { def f: a = f; } -class D[b] { class E extends C[b]; } -object Test { - val d = new D[int]; - def e = new d.E; - e.f; -} diff --git a/test/pos/bug204.scala b/test/pos/bug204.scala deleted file mode 100644 index 23d36523e9..0000000000 --- a/test/pos/bug204.scala +++ /dev/null @@ -1,7 +0,0 @@ -class A { - object B { - def f() = { - class C extends A {}; new C : A - } - } -} diff --git a/test/pos/bug210.scala b/test/pos/bug210.scala deleted file mode 100644 index 20450335f4..0000000000 --- a/test/pos/bug210.scala +++ /dev/null @@ -1,17 +0,0 @@ -trait Lang1 { - trait Exp; - trait Visitor { def f(left: Exp): unit; } - class Eval1: Visitor extends Visitor { - def f(left: Exp) = (); - } -} - -trait Lang2 extends Lang1 { - class Eval2: Visitor extends Eval1; -} -/* -object Main with Application { - val lang2 = new Lang2 {}; - val eval = new lang2.Eval2; -} -*/ diff --git a/test/pos/bug211.scala b/test/pos/bug211.scala deleted file mode 100644 index 6c5b73ec4a..0000000000 --- a/test/pos/bug211.scala +++ /dev/null @@ -1,8 +0,0 @@ -trait A; -trait B; -class Foo: (A with B) extends A with B; -object Test with Application { - new Foo(); - System.out.println("bug211 completed"); -} - diff --git a/test/pos/bug229.scala b/test/pos/bug229.scala deleted file mode 100644 index 2bceea0782..0000000000 --- a/test/pos/bug229.scala +++ /dev/null @@ -1,3 +0,0 @@ -class Test extends java.util.ArrayList { - override def add(index: int, element: java.lang.Object): unit = {} -} diff --git a/test/pos/bug245.scala b/test/pos/bug245.scala deleted file mode 100644 index 3e5dee820b..0000000000 --- a/test/pos/bug245.scala +++ /dev/null @@ -1,18 +0,0 @@ -class Value { - def coerce: Int = 0; -} - -object Test { - - def foo(i: Int): Int = 0; - - def fun0 : Value = null; - def fun0(i: Int ): Value = null; - - def fun1(i: Int ): Value = null; - def fun1(l: Long): Value = null; - - foo(fun0 ); - foo(fun1(new Value)); - -} diff --git a/test/pos/bug267.scala b/test/pos/bug267.scala deleted file mode 100644 index 3c220e5df1..0000000000 --- a/test/pos/bug267.scala +++ /dev/null @@ -1,55 +0,0 @@ -package expAbstractData; - -/** A base class consisting of - * - a root trait (i.e. abstract class) `Exp' with an `eval' function - * - an abstract type `exp' bounded by `Exp' - * - a concrete instance class `Num' of `Exp' for numeric literals - */ -trait Base { - type exp <: Exp; - - trait Exp { - def eval: int - } - class Num(v: int): exp extends Exp { - val value = v; - def eval = value - } -} - -object testBase extends Base with Application { - type exp = Exp; - val term = new Num(2); - System.out.println(term.eval); -} - -/** Data extension: An extension of `Base' with `Plus' expressions - */ -trait BasePlus extends Base { - class Plus(l: exp, r: exp): exp extends Exp { - val left = l; - val right = r; - def eval = left.eval + right.eval - } -} - -/** Operation extension: An extension of `Base' with 'show' methods. - */ -trait Show extends Base { - type exp <: Exp1; - - trait Exp1 extends Exp { - def show: String; - } - class Num1(v: int): exp extends Num(v) with Exp1 { - def show = value.toString(); - } -} - -/** Operation extension: An extension of `BasePlus' with 'show' methods. - */ -trait ShowPlus extends BasePlus with Show { - class Plus1(l: exp, r: exp): exp extends Plus(l, r) with Exp1 { - def show = left.show + " + " + right.show - } -} diff --git a/test/pos/bug29.scala b/test/pos/bug29.scala deleted file mode 100644 index 1b33c6cffd..0000000000 --- a/test/pos/bug29.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Main { - def f[a]: List[List[a]] = for (val l1 <- Nil; val l2 <- Nil) yield l1; -} diff --git a/test/pos/bug30.scala b/test/pos/bug30.scala deleted file mode 100644 index 6d28e18c0d..0000000000 --- a/test/pos/bug30.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait A { - def f(x: int): unit; - def f(x: String): unit; -} - -class B extends A { - def f(x: int): unit = (); - def f(x: String): unit = (); -} diff --git a/test/pos/bug31.scala b/test/pos/bug31.scala deleted file mode 100644 index 607dd4ce4f..0000000000 --- a/test/pos/bug31.scala +++ /dev/null @@ -1,29 +0,0 @@ -object Main { - - trait Ensure[a] { - def ensure(postcondition: a => Boolean): a - } - - def require[a](def precondition: Boolean)(def command: a): Ensure[a] = - if (precondition) - new Ensure[a] { - def ensure(postcondition: a => Boolean): a = { - val result = command; - if (postcondition(result)) result - else error("Assertion error") - } - } - else - error("Assertion error"); - - def arb[a](s: List[a]) = - require (! s.isEmpty) { - s.head - } ensure (result => s contains result); - - def main(args: Array[String]) = { - val s = List(1, 2); - System.out.println(arb(s)) - } - -} diff --git a/test/pos/bug32.scala b/test/pos/bug32.scala deleted file mode 100644 index 4354727d1a..0000000000 --- a/test/pos/bug32.scala +++ /dev/null @@ -1,17 +0,0 @@ -import java.io._; - -class PromptStream(s: OutputStream) extends PrintStream(s) { - override def println() = super.println(); -} - -object Main { - - val out = new PromptStream(System.out); - - System.setOut(out); - - def main(args: Array[String]) = - //out.println("hello world"); - () - -} diff --git a/test/pos/bug36.scala b/test/pos/bug36.scala deleted file mode 100644 index 1d923b0017..0000000000 --- a/test/pos/bug36.scala +++ /dev/null @@ -1,8 +0,0 @@ -object m { - - val xs: List[int] = Nil; - def f(i: int) = 0; - val v = xs map f; - - def m() = {} -} diff --git a/test/pos/bug39.scala b/test/pos/bug39.scala deleted file mode 100644 index a131bc0450..0000000000 --- a/test/pos/bug39.scala +++ /dev/null @@ -1,6 +0,0 @@ -abstract class Extensible[A, This <: Extensible[A, This]](x: A, xs: This): This { - def mkObj(x: A, xs: This): This; -} -class Fixed[A](x: A, xs: Fixed[A]) extends Extensible[A, Fixed[A]](x, xs) { - def mkObj(x: A, xs: Fixed[A]) = new Fixed(x, xs); -} diff --git a/test/pos/bug49.scala b/test/pos/bug49.scala deleted file mode 100644 index 913ce06e00..0000000000 --- a/test/pos/bug49.scala +++ /dev/null @@ -1,3 +0,0 @@ -class C1(x: Object) {}; - -class C2 extends C1({ class A extends Object {}; (new A) : Object }) {}; diff --git a/test/pos/bug53.scala b/test/pos/bug53.scala deleted file mode 100644 index 44763ef144..0000000000 --- a/test/pos/bug53.scala +++ /dev/null @@ -1,7 +0,0 @@ -object bug { - def foobar[c]: Int = { - class Foo { def foo: Bar = new Bar(); } - class Bar { def bar: c = bar; } - 0 - } -} diff --git a/test/pos/bug54.scala b/test/pos/bug54.scala deleted file mode 100644 index 3dc8e161fd..0000000000 --- a/test/pos/bug54.scala +++ /dev/null @@ -1,4 +0,0 @@ -class A { - case class B(x: C) extends A {} - class C {} -} diff --git a/test/pos/bug61.scala b/test/pos/bug61.scala deleted file mode 100644 index dd3f94f30c..0000000000 --- a/test/pos/bug61.scala +++ /dev/null @@ -1,10 +0,0 @@ -object O { - - class testClass ; - - case class testA() extends testClass ; // works if you leave away "extends..." - // or if you write TestA - def ga( x:testClass ) = x match { - case testA() => () - } -} diff --git a/test/pos/bug64.scala b/test/pos/bug64.scala deleted file mode 100644 index c2ce4bf6d0..0000000000 --- a/test/pos/bug64.scala +++ /dev/null @@ -1,6 +0,0 @@ -object B { - def main(Args:Array[String]) = { - val Pair(_,x) = Pair(1,2); - x + 1; - } -} diff --git a/test/pos/bug66.scala b/test/pos/bug66.scala deleted file mode 100644 index 2153264e7a..0000000000 --- a/test/pos/bug66.scala +++ /dev/null @@ -1,7 +0,0 @@ -class GBTree[A, B] /*with Map[A, B, GBTree[A,B]]*/ { - abstract class Tree[A,B]; - case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B]) - extends Tree[A,B]; - case class Nil[A,B]() extends Tree[A,B]; - -} diff --git a/test/pos/bug68.scala b/test/pos/bug68.scala deleted file mode 100644 index beb2c7c0ab..0000000000 --- a/test/pos/bug68.scala +++ /dev/null @@ -1,6 +0,0 @@ -class E { - def f() = { - val (_::l1) = List(1,2,3); - l1.tail; - } -} diff --git a/test/pos/bug69.scala b/test/pos/bug69.scala deleted file mode 100644 index 113820613f..0000000000 --- a/test/pos/bug69.scala +++ /dev/null @@ -1,11 +0,0 @@ -object testCQ { - // why does this not work directly - case class Thing( name:String, contains:List[ Thing ] ); - - /* ... but this one does? - abstract class T; - case class Thing2( name:String, contains:List[ T ] ) extends T; - */ - -} - diff --git a/test/pos/bug76.scala b/test/pos/bug76.scala deleted file mode 100644 index 07cddd714f..0000000000 --- a/test/pos/bug76.scala +++ /dev/null @@ -1,9 +0,0 @@ -// This is extracted from a test file => don't add a new test file. -object bug { - def foo(def i: Int): Int = 0; - - def bar: Int = { - var i: Int = 0; - foo (i); - } -} diff --git a/test/pos/bug81.scala b/test/pos/bug81.scala deleted file mode 100644 index 20fd604974..0000000000 --- a/test/pos/bug81.scala +++ /dev/null @@ -1,4 +0,0 @@ -class A { - val b: A#B = new B; - class B {} -} diff --git a/test/pos/bug85.scala b/test/pos/bug85.scala deleted file mode 100644 index e018afb6ee..0000000000 --- a/test/pos/bug85.scala +++ /dev/null @@ -1,8 +0,0 @@ -object A { - case class B(c: C) { - class C; - } - class C; - val b: B = new B(new C()); - val c: C = b.c; -} diff --git a/test/pos/bug91.scala b/test/pos/bug91.scala deleted file mode 100644 index e05365caf4..0000000000 --- a/test/pos/bug91.scala +++ /dev/null @@ -1,6 +0,0 @@ -class Bug { - def main(args: Array[String]) = { - var msg: String = _; // no bug if "null" instead of "_" - val f: PartialFunction[Any, unit] = { case 42 => msg = "coucou" }; - } -} diff --git a/test/pos/bug93.scala b/test/pos/bug93.scala deleted file mode 100644 index f3441fe9c3..0000000000 --- a/test/pos/bug93.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Bug { - def f(def cond: Boolean) = while (cond == false) {}; - // no bug with "false == cond" -} diff --git a/test/pos/cls.scala b/test/pos/cls.scala deleted file mode 100644 index 54104ae692..0000000000 --- a/test/pos/cls.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala._; - -package scalac.util { - -class A[X1, X2](x1: X1, x2: X2) {} -class B[Y](y1: Y, y2: Y) extends A[Y, Y](y1, y2) { - def f(x: Y, xs: B[Y]): Unit = {} - def g() = f(y1, this); -} - -object test { - val b: B[Int] = new B[Int](1, 2); - val a: A[Int, Int] = b; - val a1 = new A(1, "hello"); - val b1 = new B(1, "hello"); -} -}
\ No newline at end of file diff --git a/test/pos/cls1.scala b/test/pos/cls1.scala deleted file mode 100644 index 20ac12d59a..0000000000 --- a/test/pos/cls1.scala +++ /dev/null @@ -1,9 +0,0 @@ -package test; - -trait A { - type T; - - trait B extends A { - type T = A.this.T; - } -} diff --git a/test/pos/clsrefine.scala b/test/pos/clsrefine.scala deleted file mode 100644 index 56db9d4c13..0000000000 --- a/test/pos/clsrefine.scala +++ /dev/null @@ -1,33 +0,0 @@ -import scala._; - -package scalac.util { - -trait A { - type X1, X2; - val x1: X1, x2: X2; -} -trait B extends A { - type Y; - val y1: Y, y2: Y; - type X1 = Y, X2 = Y; - val x1 = y1, x2 = y2; - def f(x: Y, xs: B): Unit = {} - def g() = f(y1, this); -} - -object test { - val b: B { type Y = Int } = new B { - type Y = Int; - val y1 = 1, y2 = 1; - } - 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 { - type Y = Any; - val y1 = 1, y2 = "hello"; - } -} -}
\ No newline at end of file diff --git a/test/pos/compile.scala b/test/pos/compile.scala deleted file mode 100644 index f94aceedac..0000000000 --- a/test/pos/compile.scala +++ /dev/null @@ -1,19 +0,0 @@ -//############################################################################ -// Compile Time Bugs & Test Cases -//############################################################################ -// $Id$ - -import java.lang.System; // to avoid name clash with .NET's library - -//############################################################################ -// Test 0 - -class Test0Foo[X]; - -object Test0Test { - type Gen[A] = Test0Foo[A]; - class Tic(g: Test0Test.Gen[Int]); - class Tac(g: Gen[Int]); -} - -//############################################################################ diff --git a/test/pos/compound.scala b/test/pos/compound.scala deleted file mode 100644 index 60890f9102..0000000000 --- a/test/pos/compound.scala +++ /dev/null @@ -1,9 +0,0 @@ -abstract class A { type T } - -abstract class B { val xz: Any } - -abstract class Test { - var yy: A with B { type T; val xz: T } = null; - var xx: A with B { type T; val xz: T } = null; - xx = yy; -} diff --git a/test/pos/constfold.scala b/test/pos/constfold.scala deleted file mode 100644 index ef71285f72..0000000000 --- a/test/pos/constfold.scala +++ /dev/null @@ -1,14 +0,0 @@ -object A { - val x = 2; - val y = x.asInstanceOf[byte]; - val z = 1.0 / 2; - val s = "z is " + z; -} - -object Test with Application { - - System.out.println(A.x); - System.out.println(A.y); - System.out.println(A.z); - System.out.println(A.s); -} diff --git a/test/pos/eta.scala b/test/pos/eta.scala deleted file mode 100644 index 7d862f67b1..0000000000 --- a/test/pos/eta.scala +++ /dev/null @@ -1,5 +0,0 @@ -object test { - -def sum(f: Int => Int)(x: Int, y: Int): Int = 0; -def g = sum; -}
\ No newline at end of file diff --git a/test/pos/exceptions.scala b/test/pos/exceptions.scala deleted file mode 100644 index 2ba15efb4a..0000000000 --- a/test/pos/exceptions.scala +++ /dev/null @@ -1,21 +0,0 @@ -import java.io._; - -object Test { - - //def error[a](x: String):a = new java.lang.RuntimeException(x) throw; - - def main(args: Array[String]): Unit = { - try { - try { - System.out.println("hi!"); - error("xx"); - } finally { - System.out.println("ho!") - } - } catch { - case ex: IOException => System.out.println("io exception!"); - case ex => System.out.println(ex); - } - } - -} diff --git a/test/pos/expressions-current.scala b/test/pos/expressions-current.scala deleted file mode 100644 index b343dbf68b..0000000000 --- a/test/pos/expressions-current.scala +++ /dev/null @@ -1,63 +0,0 @@ -package test; - -abstract class Lang { - trait Visitor { - def caseNum(n: int): unit; - } - - abstract class Exp { - def visit(v: visitor): unit; - } - - type visitor <: Visitor; - - class Num(n: int) extends Exp { - def visit(v: visitor): unit = v.caseNum(n); - } - - class Eval(result: Ref[int]): visitor extends Visitor { - def caseNum(n: int) = result.elem = n; - } -} - -abstract class Lang2 extends Lang { - trait Visitor2 extends Visitor { - def casePlus(left: Exp, right: Exp): unit; - } - - type visitor <: Visitor2; - - class Plus(l: Exp, r: Exp) extends Exp { - def visit(v: visitor): unit = v.casePlus(l, r); - } - - class Eval2(result: Ref[int]): visitor extends Eval(result) with Visitor2 { - def casePlus(l: Exp, r: Exp) = - result.elem = { l.visit(this); result.elem } + { r.visit(this); result.elem } - } - - class Show2(result: Ref[String]): visitor extends Visitor2 { - def caseNum(n: int) = result.elem = n.toString(); - def casePlus(l: Exp, r: Exp) = - result.elem = - "(" + { l.visit(this); result.elem } + - "+" + { r.visit(this); result.elem }+ ")"; - } -} - -object Main { - - def main(args: Array[String]) = { - object l1 extends Lang { type visitor = Visitor } - val e1: l1.Exp = new l1.Num(42); - - val iref = new Ref(0); - System.out.println("eval: " + { e1.visit(new l1.Eval(iref)); iref.elem }); - - object l2 extends Lang2 { type visitor = Visitor2 } - val e2: l2.Exp = new l2.Plus(new l2.Num(5), new l2.Num(37)); - val sref = new Ref(""); - System.out.println("eval: " + { e2.visit(new l2.Eval2(iref)); iref.elem }); - System.out.println("show: " + { e2.visit(new l2.Show2(sref)); sref.elem }); - } -} diff --git a/test/pos/gui.scala b/test/pos/gui.scala deleted file mode 100644 index 27863f7368..0000000000 --- a/test/pos/gui.scala +++ /dev/null @@ -1,99 +0,0 @@ -object Geom { - trait Shape; - case class Point(x: int, y: int) extends Shape; - case class Rectangle(ll: Point, ur: Point) extends Shape { - def inset(delta: int) = - Rectangle(Point(ll.x - delta, ll.y - delta), Point(ur.x + delta, ur.y + delta)); - } -} - -object Color { - type Color = int; - val black = 0x000000; - val grey = 0x808080; -} - -trait Screen { - type Color = int; - def drawRect(r: Geom.Rectangle, c: Color): unit; - def fillRect(r: Geom.Rectangle, c: Color): unit; -} - -object DummyScreen extends Screen { - def drawRect(r: Geom.Rectangle, c: Color): unit = - System.out.println("draw " + r + " with " + c); - def fillRect(r: Geom.Rectangle, c: Color): unit = - System.out.println("fill " + r + " with " + c); -} - -object GUI { - - object Controller { - def addMouseCtl(c: MouseCtl) = () - } - - trait Glyph { - def getRect: Geom.Rectangle; - def setLoc(p: Geom.Point): unit; - def draw() = System.out.println("draw " + this); - } - - class Label(scr: Screen, p: Geom.Point, name: String) extends Glyph { - private var origin = p; - def getRect = Geom.Rectangle(origin, origin).inset(10); - def setLoc(p: Geom.Point) = { origin = p } - } - - trait Ctl { - def getGlyph: Glyph; - def enable(b: Boolean): this.type; - } - - trait MouseCtl with Ctl { - def mouseDown(p: Geom.Point): unit; - } - - abstract class Button(scr: Screen, p: Geom.Point, name: String) - extends Glyph with MouseCtl { - var enabled: boolean = false; - val label = new Label(scr, p, name); - - /* Glyph methods */ - override def draw(): unit = { - if (enabled) scr.drawRect(getRect, Color.black) - else scr.fillRect(getRect, Color.grey); - label.draw(); - } - def setLoc(p: Geom.Point) = label.setLoc(p); - def getRect = label.getRect.inset(-2); - - /* Ctl methods */ - def enable(b: boolean): this.type = { enabled = b; draw(); this } - def getGlyph = label; - final def mouseDown(p: Geom.Point): unit = - if (enabled) doit() else System.out.println("button is disabled"); - - /* deferred method to be specified by client */ - def doit(): unit; - } -} - -object GUIClient { - - class Application { - def quit() = System.out.println("application exited"); - } - - class QuitButton (scr: Screen, p: Geom.Point, name: String, a: Application) - extends GUI.Button(scr, p, name) { - def doit(): unit = a.quit(); - } - - def main(args: Array[String]) = { - val b = new QuitButton( - DummyScreen, Geom.Point(1, 1), "quit", new Application); - b.draw(); - b.enable(true).mouseDown(Geom.Point(1, 2)); - } -} - diff --git a/test/pos/imports.scala b/test/pos/imports.scala deleted file mode 100644 index 65ea090436..0000000000 --- a/test/pos/imports.scala +++ /dev/null @@ -1,16 +0,0 @@ -package test; - -import java.lang.{System => S} - -object test { - import S.out.{print => p, println => print} - - val foo = 1; - - p("hello"); print("world"); S.out.println("!"); - S.out.flush(); -} -object test1 { - import test._; - foo -}
\ No newline at end of file diff --git a/test/pos/infer.scala b/test/pos/infer.scala deleted file mode 100644 index 24871458b3..0000000000 --- a/test/pos/infer.scala +++ /dev/null @@ -1,11 +0,0 @@ -object test { - class List[+a] { - def ::[b >: a](x: b): List[b] = new Cons(x, this); - } - case class Cons[a, b <: a](x: a, xs: List[b]) extends List[a]; - case object Nil extends List[All]; - def nil[n]: List[n] = Nil; - def cons[a](x: a, xs: List[a]): List[a] = null; - val x: List[Int] = Nil.::(1); - val y: List[Int] = nil.::(1); -} diff --git a/test/pos/infer2.scala b/test/pos/infer2.scala deleted file mode 100644 index 66f3d76544..0000000000 --- a/test/pos/infer2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object test { - - def f[a, b <: a](x: b): a = x: a; - def g[a >: b, b](x: b): a = x: a; - - val x: int = f(1); - val y: String = g("") - -} - diff --git a/test/pos/lambda.scala b/test/pos/lambda.scala deleted file mode 100644 index 187b3f9783..0000000000 --- a/test/pos/lambda.scala +++ /dev/null @@ -1,8 +0,0 @@ -object test { - - def apply[a,b](f: a => b): a => b = x: a => f(x); - - def twice[a](f: a => a): a => a = x: a => f(f(x)); - - def main = apply[Int,Int](twice[Int](x: Int => x))(1); -}
\ No newline at end of file diff --git a/test/pos/lambdalift.scala b/test/pos/lambdalift.scala deleted file mode 100644 index ae5799a6f8..0000000000 --- a/test/pos/lambdalift.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala._; - -object test { - - def f(x: Int) = { - def g() = h(); - def h() = x; - g(); - class inner() { - def g() = h(); - def h() = x; - } - g() + new inner().g(); - } -}
\ No newline at end of file diff --git a/test/pos/lambdalift1.scala b/test/pos/lambdalift1.scala deleted file mode 100644 index d9172f51eb..0000000000 --- a/test/pos/lambdalift1.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala._; - -object test { - - def f[a <: java.lang.Object](x: a) = { - def print() = java.lang.System.out.println(x); - class A() { - def g() = { - class B() { - def h() = print() - } - new B().h() - } - } - new A().g() - } -}
\ No newline at end of file diff --git a/test/pos/localmodules.scala b/test/pos/localmodules.scala deleted file mode 100644 index 8ed34f455a..0000000000 --- a/test/pos/localmodules.scala +++ /dev/null @@ -1,22 +0,0 @@ -package test; - -object main { - - class a { - - object b { - - trait c {} - def foo(x: c): c = { System.out.println("foo(" + x + ")"); x } - - } - - def bar(x: b.c): a.this.b.c = { b.foo(x); x } - } - - def main(args: Array[String]) = { - val aa = new a; - val xx: aa.b.c = null; - System.out.println(aa.bar(xx)); - } -} diff --git a/test/pos/matthias1.scala b/test/pos/matthias1.scala deleted file mode 100644 index a923a529fe..0000000000 --- a/test/pos/matthias1.scala +++ /dev/null @@ -1,15 +0,0 @@ -class A() { - class B() { - def foo(x: B) = 0 - } -} -object test { - def main = { - val a = new A(); - val b = new a.B(); - val c = new a.B(); - val d = b.foo(c); - () - } -} - diff --git a/test/pos/matthias3.scala b/test/pos/matthias3.scala deleted file mode 100644 index 6e86afeca6..0000000000 --- a/test/pos/matthias3.scala +++ /dev/null @@ -1,13 +0,0 @@ - -abstract class A() { - val y: A; -} -class B() extends A() { - val x = this; - val y: x.type = x; -} -abstract class C() { - val b: B = new B(); - val a: A { val y: b.type }; -} - diff --git a/test/pos/matthias4.scala b/test/pos/matthias4.scala deleted file mode 100644 index bcda93746b..0000000000 --- a/test/pos/matthias4.scala +++ /dev/null @@ -1,84 +0,0 @@ -/* -object A requires B { - B.X getX() { - return B.getX(); - } - void setX(B.X x) {} -} -object B { - class X {} - X getX() { - return new X(); - } - void setX(X x) {} -} -object C requires B { - object A; - void test() { - A.setX(B.getX()); - } -} -*/ - -trait _a extends Object with _b { - val a: _a; - val A: A; - type A <: a.AObject; - trait AObject { - def getX(): B.X; - def setX(x: B.X): Unit; - } -} -abstract class a123() extends Object with _a with _b { - val a: this.type = this; - val A: A = new A(); - class A() extends AObject { - def getX(): B.X = B.getX(); - def setX(x: B.X) = B.setX(x); - } -} - -trait _b { - val b: _b; - val B: B; - type B <: b.BObject; - trait BObject { - type X; - def getX(): X; - def setX(x: X): Unit; - } -} -abstract class b() extends Object with _b { - val b: this.type = this; - val B: B = new B(); - class B() extends BObject { - class X() {} - def getX(): X = new X(); - def setX(x: X) = (); - } -} - -trait _m { - val m: _m; - val M: M; - type M <: m.MObject; - trait MObject {} -} -abstract class m() extends Object with _m with _b { - val m: this.type = this; - val M: M = new M(); - class M() extends MObject with a123() with Linker() { - def test() = { - val x: B.X = B.getX(); - A.setX(x); - } - } - abstract class Linker() { - val b: m.this.b.type = m.this.b; - val B: m.this.B.type = m.this.B; - type B = m.this.B; - val m: m.this.m.type = m.this.m; - val M: m.this.M.type = m.this.M; - type M = m.this.M; - } -} diff --git a/test/pos/matthias5.scala b/test/pos/matthias5.scala deleted file mode 100644 index 0dcb7f833d..0000000000 --- a/test/pos/matthias5.scala +++ /dev/null @@ -1,12 +0,0 @@ -abstract class A() { - val y: A; -} -class B() extends A() { - val x = this; - val y: x.type = x; -} -abstract class C() { - val b: B = new B(); - val a: A { val y: b.type }; -} - diff --git a/test/pos/maxim1.scala b/test/pos/maxim1.scala deleted file mode 100644 index 58916beb8a..0000000000 --- a/test/pos/maxim1.scala +++ /dev/null @@ -1,5 +0,0 @@ -object test { - def f(x: Int)(y: Int) = x + y; - def y: Int => Int = f(2); - def main = y(1); -} diff --git a/test/pos/michel1.scala b/test/pos/michel1.scala deleted file mode 100644 index 2fc409b4e5..0000000000 --- a/test/pos/michel1.scala +++ /dev/null @@ -1,9 +0,0 @@ -class A[Ta] (a : Ta) { - def f = 1 -} - -trait C {} - -class B[Tb] (b : Tb) extends C with A[Tb] (b) { - def g = 2 -} diff --git a/test/pos/michel2.scala b/test/pos/michel2.scala deleted file mode 100644 index e6976b0f40..0000000000 --- a/test/pos/michel2.scala +++ /dev/null @@ -1,16 +0,0 @@ -object Test { - - trait A extends Object { - def f : Int = 1 - } - - class B extends Object with A { - override def f : Int = super[A].f - } - - def main(args: Array[String]) = - System.out.println(new B().f); -} - - - diff --git a/test/pos/michel3.scala b/test/pos/michel3.scala deleted file mode 100644 index 0e85295bfb..0000000000 --- a/test/pos/michel3.scala +++ /dev/null @@ -1,3 +0,0 @@ -abstract class A() { - val v : Int -}
\ No newline at end of file diff --git a/test/pos/michel4.scala b/test/pos/michel4.scala deleted file mode 100644 index 2390be5d26..0000000000 --- a/test/pos/michel4.scala +++ /dev/null @@ -1,7 +0,0 @@ -class A() { - val f : Int = 2 -} - -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 deleted file mode 100644 index 345ae04d9d..0000000000 --- a/test/pos/michel5.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait A[Ta] { } - -class B() extends Object with A[Int] { - val x : Int = 2 -}
\ No newline at end of file diff --git a/test/pos/michel6.scala b/test/pos/michel6.scala deleted file mode 100644 index b32e8bed75..0000000000 --- a/test/pos/michel6.scala +++ /dev/null @@ -1,6 +0,0 @@ -object M { - def f(x: Int): Unit = {} - - def g(): Int => Unit = - if (0 == 0) f else g() - } diff --git a/test/pos/mixins.scala b/test/pos/mixins.scala deleted file mode 100644 index 8d7e7dfa52..0000000000 --- a/test/pos/mixins.scala +++ /dev/null @@ -1,17 +0,0 @@ -package mixins; -abstract class Super { - def foo: int; -} -abstract class Mixin extends Super { - abstract override def foo = super.foo; -} -class Sub extends Super with Mixin { - override def foo: int = 1; -} -abstract class Mixin1 extends Mixin { - abstract override def foo = super.foo; -} -abstract class Base0 extends Super with Mixin { -} -class Base extends Sub with Mixin1 { -} diff --git a/test/pos/modules.scala b/test/pos/modules.scala deleted file mode 100644 index 8168a42d3c..0000000000 --- a/test/pos/modules.scala +++ /dev/null @@ -1,14 +0,0 @@ -package scala { - - object a { - - object b { - - trait c {} - def foo(x: c): c = bar(x) - - } - - def bar(x: b.c): b.c = x - } -} diff --git a/test/pos/modules1.scala b/test/pos/modules1.scala deleted file mode 100644 index 3da14af4fe..0000000000 --- a/test/pos/modules1.scala +++ /dev/null @@ -1,14 +0,0 @@ -package scala { - - object a { - - object b { - - trait c {} - def foo(x: c): c = bar(x) - - } - - def bar(x: b.c): a.b.c = { b.foo(x); x } - } -} diff --git a/test/pos/moduletrans.scala b/test/pos/moduletrans.scala deleted file mode 100644 index 51538417ed..0000000000 --- a/test/pos/moduletrans.scala +++ /dev/null @@ -1,8 +0,0 @@ -object m1 { - - class m() { - def f() = 5 - } - final val m: m = new m() - -} diff --git a/test/pos/nested.scala b/test/pos/nested.scala deleted file mode 100644 index e81b710d72..0000000000 --- a/test/pos/nested.scala +++ /dev/null @@ -1,27 +0,0 @@ -// A non-trivial example of nested classes (mostly to test -// ExplicitOuterClasses). - -class A(pa : Int) { - def a1 = pa; - class B(pb : Int) { - def b1 = pa+pb+a1; - class C(pc : Int) extends A(b1) { - def c1 = pc+pb+pa - } - val c1 = new C(66) - } -} - -class M(x : Int) { - def m1 = x -} - -class A1(x : Int) extends A(x) with M(x) { - class D() extends B(42) { - val c2 = new C(66); - class E() extends C(5) { - def e1 = c1+b1+a1; - def e2 = new D(); - } - } -} diff --git a/test/pos/null.scala b/test/pos/null.scala deleted file mode 100644 index 59f88ee0e0..0000000000 --- a/test/pos/null.scala +++ /dev/null @@ -1,3 +0,0 @@ -object M { - val x: Boolean = null == null; -}
\ No newline at end of file diff --git a/test/pos/override.scala b/test/pos/override.scala deleted file mode 100644 index 9f068b8ecd..0000000000 --- a/test/pos/override.scala +++ /dev/null @@ -1,14 +0,0 @@ -trait A extends Object { - def f = 1; - val x: A; -} - -trait B extends Object { - def f = 2; -} - -trait C extends Object with A with B { - override def f = super[B].f; - val a: A; - val x: a.type = a; -} diff --git a/test/pos/partialfun.scala b/test/pos/partialfun.scala deleted file mode 100644 index 21e4d0a096..0000000000 --- a/test/pos/partialfun.scala +++ /dev/null @@ -1,10 +0,0 @@ -object partialfun { - - def applyPartial[b](f: PartialFunction[Option[String], b])(x: Option[String]) = - if (f.isDefinedAt(x)) f(x) else "<undefined>"; - - applyPartial { - case Some(xxx) => xxx - } (None); - -}
\ No newline at end of file diff --git a/test/pos/patterns.scala b/test/pos/patterns.scala deleted file mode 100644 index f996f89725..0000000000 --- a/test/pos/patterns.scala +++ /dev/null @@ -1,27 +0,0 @@ -trait Option[+a] {} -case class Some[a](x: a) extends Option[a] { - override def toString(): scala.String = "Some(" + x + ")"; - override def equals(that: Any): Boolean = that match { - case Some(x) => this.x == x - case _ => false - } - override def hashCode(): scala.Int = getClass().hashCode() * 41 + x.hashCode(); -} -case object None extends Option[All] { - override def toString(): scala.String = "None"; - override def equals(that: Any) = that match { - case None => true - case _ => false - } - override def hashCode(): scala.Int = getClass().hashCode(); -} - -object test { - - def println(str: String): Unit = java.lang.System.out.println(str); - - def print(opt: Option[String]) = opt match { - case Some(x) => println(x); - case None => println("nothing"); - } -}
\ No newline at end of file diff --git a/test/pos/patterns1.scala b/test/pos/patterns1.scala deleted file mode 100644 index fa542e7b06..0000000000 --- a/test/pos/patterns1.scala +++ /dev/null @@ -1,13 +0,0 @@ -trait Option[+a] {} -case class Some[a](x: a) extends Option[a]; -case object None extends Option[All]; - -object test { - - def println(str: String): Unit = java.lang.System.out.println(str); - - def print(opt: Option[String]) = opt match { - case Some(x) => println(x); - case None => println("nothing"); - } -}
\ No newline at end of file diff --git a/test/pos/patterns2.scala b/test/pos/patterns2.scala deleted file mode 100644 index 93dcedbcf8..0000000000 --- a/test/pos/patterns2.scala +++ /dev/null @@ -1,16 +0,0 @@ -trait Option {} -case class Choice(a: Option, b: Option) extends Option; -case class Some(x: java.lang.String) extends Option; -case object None extends Option; - -object test { - - def f(opt: Option) = opt match { - case Choice(Some("one"), Some(x)) => 1; - case Choice(Some("two"), None) => 1; - case Choice(y, Some("two")) => 2; - case Choice(Some(z), a) => 3; - case Some(b) => 4; - case None => 5; - } -}
\ No newline at end of file diff --git a/test/pos/patterns3.scala b/test/pos/patterns3.scala deleted file mode 100644 index 001bd8989f..0000000000 --- a/test/pos/patterns3.scala +++ /dev/null @@ -1,5 +0,0 @@ -object M { - - val Tuple2(Tuple2(x, y), _) = Tuple2(Tuple2(1, 2), 3); - -} diff --git a/test/pos/philippe1.scala b/test/pos/philippe1.scala deleted file mode 100644 index 3cace0e116..0000000000 --- a/test/pos/philippe1.scala +++ /dev/null @@ -1,8 +0,0 @@ -object test { - def id[a](xs: Array[a]): Array[a] = xs; - - def main(args: Array[String]): Unit = { - val res: Array[String] = id(args); - () - } -}
\ No newline at end of file diff --git a/test/pos/philippe2.scala b/test/pos/philippe2.scala deleted file mode 100644 index 0dc896ebfd..0000000000 --- a/test/pos/philippe2.scala +++ /dev/null @@ -1,7 +0,0 @@ - -import scala._; -class m1() { - def n() = 0; - def foo(i: Int)(j: Int): Unit = (); - val bar = foo(n()); -} diff --git a/test/pos/philippe3.scala b/test/pos/philippe3.scala deleted file mode 100644 index 9442583997..0000000000 --- a/test/pos/philippe3.scala +++ /dev/null @@ -1,40 +0,0 @@ - -class Foo(x: Int) {} -case class Bar(y: Int) extends Foo(y); - - -trait T {} -trait U {} -class C() {} - - -trait T1; -trait T2 {} -trait T5 extends T; -trait T6 extends T {} -trait T7 extends T with U; -trait T8 extends T with U {} - -class C1(); -class C2() {} -class C5() extends C(); -class C6() extends C() {} -class C7() extends C() with U; -class C8() extends C() with U {} - -case class D1(); -case class D2() {} -case class D5() extends C(); -case class D6() extends C() {} -case class D7() extends C() with U; -case class D8() extends C() with U {} - -object M1; -object M2 {} -object M5 extends C(); -object M6 extends C() {} -object M7 extends C() with U; -object M8 extends C() with U {} - - - diff --git a/test/pos/philippe4.scala b/test/pos/philippe4.scala deleted file mode 100644 index c9b1cdaeb0..0000000000 --- a/test/pos/philippe4.scala +++ /dev/null @@ -1,3 +0,0 @@ -trait Foo[t <: Foo[t]]: t { - def foo(that: t): Boolean; -} diff --git a/test/pos/pmbug.scala b/test/pos/pmbug.scala deleted file mode 100644 index 7d94e7a8bd..0000000000 --- a/test/pos/pmbug.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - - def flatten[a](l: List[List[a]]): List[a] = l match { - case Nil => Nil - case head :: tail => head ::: flatten(tail) - } - -} diff --git a/test/pos/propagate.scala b/test/pos/propagate.scala deleted file mode 100644 index 84f4f5d6d2..0000000000 --- a/test/pos/propagate.scala +++ /dev/null @@ -1,17 +0,0 @@ -class C { - - def f[a](x: a): a = { - - class D() { - def g(x: a) = f(x): a; - } - - new D().g(x); - - } - -} - - - - diff --git a/test/pos/rebind.scala b/test/pos/rebind.scala deleted file mode 100644 index 59afe82ffa..0000000000 --- a/test/pos/rebind.scala +++ /dev/null @@ -1,13 +0,0 @@ -abstract class Foo { - class Inner { - def inner: int = 1; - } - def foo: Inner; -} -abstract class Bar { - type Inner; - def foo: Inner = foo; -} -class Test extends Foo with Bar { - System.out.println(foo.inner); -} diff --git a/test/pos/refine.scala b/test/pos/refine.scala deleted file mode 100644 index 255621ad43..0000000000 --- a/test/pos/refine.scala +++ /dev/null @@ -1,6 +0,0 @@ -object test { - - val x: Object { def toString(): String } = new Object { - override def toString(): String = "1"; - } -} diff --git a/test/pos/reftest.scala b/test/pos/reftest.scala deleted file mode 100644 index f709f70897..0000000000 --- a/test/pos/reftest.scala +++ /dev/null @@ -1,4 +0,0 @@ -import scala._; -object test { - val x: Ref[Int] = new Ref(1); -}
\ No newline at end of file diff --git a/test/pos/scall.bat b/test/pos/scall.bat deleted file mode 100644 index 4e9f31425e..0000000000 --- a/test/pos/scall.bat +++ /dev/null @@ -1,50 +0,0 @@ -scalac -prompt A.scala; -scalac -prompt IntSet.scala; -scalac -prompt List1.scala; -scalac -prompt Rational.scala; -scalac -prompt X.scala; -scalac -prompt Y.scala; -scalac -prompt Z.scala; -scalac -prompt abstract.scala; -scalac -prompt cls.scala; -scalac -prompt cls1.scala; -scalac -prompt clsrefine.scala; -scalac -prompt cours1.scala; -scalac -prompt cours2.scala; -scalac -prompt cours2a.scala; -scalac -prompt cours2b.scala; -scalac -prompt cours2c.scala; -scalac -prompt eta.scala; -scalac -prompt exceptions.scala; -scalac -prompt imports.scala; -scalac -prompt lambda.scala; -scalac -prompt lambdalift.scala; -scalac -prompt lambdalift1.scala; -scalac -prompt matthias1.scala; -scalac -prompt maxim1.scala; -scalac -prompt michel1.scala; -scalac -prompt michel2.scala; -scalac -prompt michel3.scala; -scalac -prompt michel4.scala; -scalac -prompt michel5.scala; -scalac -prompt modules.scala; -scalac -prompt modules1.scala; -scalac -prompt moduletrans.scala; -scalac -prompt nested.scala; -scalac -prompt override.scala; -scalac -prompt patterns.scala; -scalac -prompt patterns2.scala; -scalac -prompt philippe1.scala; -scalac -prompt philippe2.scala; -scalac -prompt reftest.scala; -scalac -prompt sort1.scala; -scalac -prompt sqrt.scala; -scalac -prompt stable.scala; -scalac -prompt strings.scala; -scalac -prompt test1.scala; -scalac -prompt test2.scala; -scalac -prompt test4.scala; -scalac -prompt test4a.scala; -scalac -prompt test4refine.scala; -scalac -prompt test5.scala; -scalac -prompt test5refine.scala; diff --git a/test/pos/scoping1.scala b/test/pos/scoping1.scala deleted file mode 100644 index c9bc14b563..0000000000 --- a/test/pos/scoping1.scala +++ /dev/null @@ -1,12 +0,0 @@ -object This with Application { - trait A { - def foo(): unit; - } - class C: A { - def bar() = this.foo(); - } - class D extends C with A { - def foo() = () - } - val c: C = new D; -} diff --git a/test/pos/scoping2.scala b/test/pos/scoping2.scala deleted file mode 100644 index 39f3ef5f0e..0000000000 --- a/test/pos/scoping2.scala +++ /dev/null @@ -1,14 +0,0 @@ -object That { - trait A { - type T <: I; - trait I {} - } - trait B { - type T <: J; - trait J {} - } - trait C extends A with B { - type T <: I with J; - } -} - diff --git a/test/pos/scoping3.scala b/test/pos/scoping3.scala deleted file mode 100644 index 4ebc7f6378..0000000000 --- a/test/pos/scoping3.scala +++ /dev/null @@ -1,20 +0,0 @@ -object CI { - trait TreeDisplay { - type TreeNode <: ITreeNode; - trait ITreeNode { - def display(): unit; - } - } - trait TreeDisplayExp { - def getRoot(): TreeNode; - type TreeNode <: ITreeNodeExp; - trait ITreeNodeExp {} - } - trait TreeDisplayFinal extends TreeDisplay with TreeDisplayExp { - type TreeNode <: ITreeNode with ITreeNodeExp; - } - abstract class SimpleTreeDisplay: TreeDisplayFinal extends -TreeDisplay { - def display() = { this.getRoot().display(); } - } -} diff --git a/test/pos/seqtest2.scala b/test/pos/seqtest2.scala deleted file mode 100644 index 903b270c95..0000000000 --- a/test/pos/seqtest2.scala +++ /dev/null @@ -1,13 +0,0 @@ -object test { - - val b = List(1, 2, 3); - - def main(args: Array[String]) = - System.out.println( - b match { - case List(1, 2, 3) => true; - case _ => false; - } - ) - -} diff --git a/test/pos/simplelists.scala b/test/pos/simplelists.scala deleted file mode 100644 index 73b04a8762..0000000000 --- a/test/pos/simplelists.scala +++ /dev/null @@ -1,17 +0,0 @@ - abstract class List[+a] { - def head: a; - def tail: List[a]; - def cons[b >: a](x: b): List[b] = new Cons[b, a](x, this); - } - - object Nil extends List[All] { - def error(msg: String): All = throw new java.lang.Error(msg); - def head: All = error("Nil.head"); - def tail: List[All] = error("Nil.tail"); - } - - class Cons[c, d <: c](x: c, xs: List[d]) extends List[c] { - def head: c = x; - def tail: List[c] = xs; - } - diff --git a/test/pos/stable.scala b/test/pos/stable.scala deleted file mode 100644 index 267a36fe5c..0000000000 --- a/test/pos/stable.scala +++ /dev/null @@ -1,11 +0,0 @@ -trait Base { - val x: Int; - val y: Int; - var z: Int; -} - -class Sub() extends Base { - val x: Int = 1; - val y: Int = 2; - var z: Int = 3; -} diff --git a/test/pos/strings.scala b/test/pos/strings.scala deleted file mode 100644 index 3bf40e3dda..0000000000 --- a/test/pos/strings.scala +++ /dev/null @@ -1,6 +0,0 @@ -// martin 1-3-2002: it seems there is a problem with the way Serializable is loaded. -object test { - - def f() = "hello".concat("world"); - -} diff --git a/test/pos/test1.scala b/test/pos/test1.scala deleted file mode 100644 index a36d2436ec..0000000000 --- a/test/pos/test1.scala +++ /dev/null @@ -1,5 +0,0 @@ -object test { - - def f() = 5; - -} diff --git a/test/pos/test2.scala b/test/pos/test2.scala deleted file mode 100644 index fe36d07f1b..0000000000 --- a/test/pos/test2.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala._; -object test2 { - def f(x: Int): Int = 'a'; - def g(x: Int) = f(f(x)); -}
\ No newline at end of file diff --git a/test/pos/test4.scala b/test/pos/test4.scala deleted file mode 100644 index 66f7a1505c..0000000000 --- a/test/pos/test4.scala +++ /dev/null @@ -1,45 +0,0 @@ -trait C {} -trait D {} -trait E {} - -object test { - def c: C = c; - def d: D = d; - def e: E = e; -} - -import test._; - -trait S extends ooo.I[D] { - def bar: E = foo(c,d); -} - -class O[X]() { - trait I[Y] { - def foo(x: X, y: Y): E = e; - } - val i:I[E] = null; - val j:I[X] = null; -} - -object ooo extends O[C]() { - - def main = { - val s: S = null; - import s._; - foo(c,d); - ooo.i.foo(c,e); - ooo.j.foo(c,c); - bar - } -} - -class Main() { - val s: S = null; - import s._; - foo(c,d); - ooo.i.foo(c,e); - ooo.j.foo(c,c); - bar; -} - diff --git a/test/pos/test4a.scala b/test/pos/test4a.scala deleted file mode 100644 index ada0ba4e5f..0000000000 --- a/test/pos/test4a.scala +++ /dev/null @@ -1,16 +0,0 @@ -trait C {} - -class O[X]() { - trait I[Y] { - def foo(y: Y): Y = y; - } - val j:I[X] = null; -} - -object o extends O[C]() { - def c: C = c; - def main = { - o.j.foo(c); - } -} - diff --git a/test/pos/test4refine.scala b/test/pos/test4refine.scala deleted file mode 100644 index 6710962934..0000000000 --- a/test/pos/test4refine.scala +++ /dev/null @@ -1,49 +0,0 @@ -trait C {} -trait D {} -trait E {} - -object test { - def c: C = c; - def d: D = d; - def e: E = e; -} - -import test._; - -trait S extends o.I { - type Y = D; - def bar: E = foo(c,d); -} - -abstract class O() { - type X; - abstract trait I { - type Y; - def foo(x: X, y: Y): E = e; - } - val i:I { type Y = E } = null; - val j:I { type Y = X } = null; -} - -object o extends O() { - type X = C; - - def main = { - val s: S = null; - import s._; - foo(c,d); - o.i.foo(c,e); - o.j.foo(c,c); - bar - } -} - -class Main() { - val s: S = null; - import s._; - foo(c,d); - o.i.foo(c,e); - o.j.foo(c,c); - bar; -} - diff --git a/test/pos/test5.scala b/test/pos/test5.scala deleted file mode 100644 index 4dbafc9ac3..0000000000 --- a/test/pos/test5.scala +++ /dev/null @@ -1,68 +0,0 @@ -import scala._; - -object test { - - trait F[If] {} - - def f[Jf](h: Jf):F[Jf] = f[Jf](h); - - trait G[Ig] {} - - def g[Jg](h: Jg):G[Jg] = g[Jg](h); - - class M[P]() { - abstract class I[X]() { - // Methods to check the type X and P as seen from instances of I - def chk_ix(x: X): Unit = (); - def chk_ip(p: P): Unit; - - // Value with type X as seen from instances of I - def val_ix: X = val_ix; - } - - val i:I[G[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[P] = g[P](val_mp); - } - - class N[Q]() extends M[F[Q]]() { - val j:J[G[Q]] = null; - - abstract class J[Y]() extends I[G[Y]]() { - // Values with types Y and X as seen from instances of J - def val_jy: Y = val_jy; - def val_jx: G[Y] = g[Y](val_jy); - - // Check type P - chk_ip(val_mp); - chk_ip(val_np); - } - - // 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[Q] = f[Q](val_nq); - def val_nix: G[F[Q]] = g[F[Q]](val_np); - def val_njy: G[Q] = g[Q](val_nq); - def val_njx: G[G[Q]] = g[G[Q]](val_njy); - - // Check type i.P - i.chk_ip(val_mp); - i.chk_ip(val_np); - - // Check type j.P - j.chk_ip(val_mp); - j.chk_ip(val_np); - - // Check type i.X - i.chk_ix(i.val_ix); - i.chk_ix(val_mix); - i.chk_ix(val_nix); - - // Check j.X - j.chk_ix(j.val_ix); - j.chk_ix(j.val_jx); - j.chk_ix(val_njx); - } -} diff --git a/test/pos/test5refine.scala b/test/pos/test5refine.scala deleted file mode 100644 index 95670faa05..0000000000 --- a/test/pos/test5refine.scala +++ /dev/null @@ -1,75 +0,0 @@ -import scala._; - -object test { - - abstract trait F { type If; } - - def f[Jf](h: Jf):F { type If = Jf } = f[Jf](h); - - abstract trait G { type Ig; } - - def g[Jg](h: Jg):G { type Ig = Jg } = g[Jg](h); - - abstract class M() { - type P; - abstract class I() { - type X; - - // Methods to check the type X and P as seen from instances of I - def chk_ix(x: X): Unit = {} - def chk_ip(p: P): Unit = {} - - // Value with type X as seen from instances of I - def val_ix: X = val_ix; - } - - 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 { type Ig = P } = g[P](val_mp); - } - - abstract class N() extends M() { - type Q; - 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 { 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 { type Ig = Y; } = g[Y](val_jy); - - // Check type P - chk_ip(val_mp); - chk_ip(val_np); - } - - // 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 { 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); - i.chk_ip(val_np); - - // Check type j.P - j.chk_ip(val_mp); - j.chk_ip(val_np); - - // Check type i.X - i.chk_ix(i.val_ix); - i.chk_ix(val_mix); - i.chk_ix(val_nix); - - // Check j.X - j.chk_ix(j.val_ix); - j.chk_ix(j.val_jx); - j.chk_ix(val_njx); - } -}
\ No newline at end of file diff --git a/test/pos/thistype.scala b/test/pos/thistype.scala deleted file mode 100644 index 8c0ba209be..0000000000 --- a/test/pos/thistype.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - - class Ctl { - def enable: this.type = { System.out.println("enable"); this } - } - - class MouseCtl extends Ctl { - def mouseDown(x: int, y: int): unit = { System.out.println("mouse down"); } - } - - def main(args: Array[String]) = - new MouseCtl().enable.mouseDown(1, 2); - -} diff --git a/test/pos/thistypes.scala b/test/pos/thistypes.scala deleted file mode 100644 index 4a68ba3e65..0000000000 --- a/test/pos/thistypes.scala +++ /dev/null @@ -1,8 +0,0 @@ -trait B { - trait I {} - def foo: B.this.I; -} - -trait C extends B { - def foo: C.this.I; -}
\ No newline at end of file diff --git a/test/pos/traits.scala b/test/pos/traits.scala deleted file mode 100644 index 5fdf4b342e..0000000000 --- a/test/pos/traits.scala +++ /dev/null @@ -1,42 +0,0 @@ -object Test { - type Color = int; - trait Shape { - override def equals(other: Any) = true; - } - trait Bordered extends Shape { - val thickness: int; - override def equals(other: Any) = other match { - case that: Bordered => this.thickness == that.thickness; - case _ => false - } - } - trait Colored extends Shape { - val color: Color; - override def equals(other: Any) = other match { - case that: Colored => this.color == that.color; - case _ => false - } - } - trait BorderedColoredShape extends Shape with Bordered with Colored { - override def equals(other: Any) = other match { - case that: BorderedColoredShape => - super.equals(that) && - super[Bordered].equals(that) && - super[Colored].equals(that) - case _ => false - } - } - - val bcs1 = new BorderedColoredShape { - val thickness = 1; - val color = 0; - } - val bcs2 = new BorderedColoredShape { - val thickness = 2; - val color = 0; - } - System.out.println(bcs1 == bcs1); - System.out.println(bcs1 == bcs2); -} - - diff --git a/test/pos/valdefs.scala b/test/pos/valdefs.scala deleted file mode 100644 index 85ffa132b7..0000000000 --- a/test/pos/valdefs.scala +++ /dev/null @@ -1,16 +0,0 @@ -object test { - - abstract class Base() { - val x: String; - val y = 1.0; - } - - case class Sub() extends Base() { - val x = "hello"; - override val y = 2.0; - } - - abstract class Sub2() extends Base() { - override val Pair(x, y) = Pair("abc", 2.0); - } -} diff --git a/test/pos/vincent.scala b/test/pos/vincent.scala deleted file mode 100644 index eed25eb84c..0000000000 --- a/test/pos/vincent.scala +++ /dev/null @@ -1,21 +0,0 @@ -object test { - - trait A { type T; } - - trait B { type T; } - - /** def functor(x: A): B { type T = x.T } */ - abstract class functor() { - val arg: A; - val res: B { type T = arg.T } = - new B { type T = arg.T; }; - } - - val a = new A { type T = String }; - /** val b: B { type T = String } = functor(a) */ - val b: B { type T = String } = { - val tmp = new functor() { val arg = a }; - tmp.res - } - -} |