From 836f5fbd907fe00bd9bd3849f1d41b13c2afd53a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 7 Jan 2004 15:28:48 +0000 Subject: *** empty log message *** --- test/files/neg/bug44.check | 6 --- test/files/neg/bug44.scala | 5 --- test/files/neg/refine.check | 6 --- test/files/neg/refine.scala | 6 --- test/files/neg/vincent1.check | 7 --- test/files/neg/vincent1.scala | 19 -------- test/files/pos/List1.scala | 45 ------------------- test/files/pos/clsrefine.scala | 33 -------------- test/files/pos/compound.scala | 9 ---- test/files/pos/expressions-current.scala | 4 +- test/files/pos/matthias3.scala | 13 ------ test/files/pos/matthias5.scala | 12 ----- test/files/pos/refine.scala | 6 --- test/files/pos/scoping2.scala | 2 +- test/files/pos/test4refine.scala | 49 --------------------- test/files/pos/test5.scala | 2 +- test/files/pos/test5refine.scala | 75 -------------------------------- test/files/pos/vincent.scala | 21 --------- test/neg/bug44.check | 6 --- test/neg/bug44.scala | 5 --- test/neg/refine.check | 6 --- test/neg/refine.scala | 6 --- test/neg/vincent1.check | 7 --- test/neg/vincent1.scala | 19 -------- test/pos/List1.scala | 45 ------------------- test/pos/clsrefine.scala | 33 -------------- test/pos/compound.scala | 9 ---- test/pos/expressions-current.scala | 4 +- test/pos/matthias3.scala | 13 ------ test/pos/matthias5.scala | 12 ----- test/pos/refine.scala | 6 --- test/pos/scoping2.scala | 2 +- test/pos/test4refine.scala | 49 --------------------- test/pos/test5.scala | 2 +- test/pos/test5refine.scala | 75 -------------------------------- test/pos/vincent.scala | 21 --------- 36 files changed, 8 insertions(+), 632 deletions(-) delete mode 100644 test/files/neg/bug44.check delete mode 100644 test/files/neg/bug44.scala delete mode 100644 test/files/neg/refine.check delete mode 100644 test/files/neg/refine.scala delete mode 100644 test/files/neg/vincent1.check delete mode 100644 test/files/neg/vincent1.scala delete mode 100644 test/files/pos/List1.scala delete mode 100644 test/files/pos/clsrefine.scala delete mode 100644 test/files/pos/compound.scala delete mode 100644 test/files/pos/matthias3.scala delete mode 100644 test/files/pos/matthias5.scala delete mode 100644 test/files/pos/refine.scala delete mode 100644 test/files/pos/test4refine.scala delete mode 100644 test/files/pos/test5refine.scala delete mode 100644 test/files/pos/vincent.scala delete mode 100644 test/neg/bug44.check delete mode 100644 test/neg/bug44.scala delete mode 100644 test/neg/refine.check delete mode 100644 test/neg/refine.scala delete mode 100644 test/neg/vincent1.check delete mode 100644 test/neg/vincent1.scala delete mode 100644 test/pos/List1.scala delete mode 100644 test/pos/clsrefine.scala delete mode 100644 test/pos/compound.scala delete mode 100644 test/pos/matthias3.scala delete mode 100644 test/pos/matthias5.scala delete mode 100644 test/pos/refine.scala delete mode 100644 test/pos/test4refine.scala delete mode 100644 test/pos/test5refine.scala delete mode 100644 test/pos/vincent.scala (limited to 'test') diff --git a/test/files/neg/bug44.check b/test/files/neg/bug44.check deleted file mode 100644 index 9347758ac9..0000000000 --- a/test/files/neg/bug44.check +++ /dev/null @@ -1,6 +0,0 @@ -bug44.scala:2: type mismatch; - found : scala.Object - required: scala.Object { def t: scala.Int } - var x: Object { def t: Int; } = new Object() { - ^ -one error found diff --git a/test/files/neg/bug44.scala b/test/files/neg/bug44.scala deleted file mode 100644 index 7989838250..0000000000 --- a/test/files/neg/bug44.scala +++ /dev/null @@ -1,5 +0,0 @@ -abstract class C { - var x: Object { def t: Int; } = new Object() { - def t: Int = 1; - } -} diff --git a/test/files/neg/refine.check b/test/files/neg/refine.check deleted file mode 100644 index 271451e65e..0000000000 --- a/test/files/neg/refine.check +++ /dev/null @@ -1,6 +0,0 @@ -refine.scala:3: type mismatch; - found : scala.Object - required: scala.Object { def t(): java.lang.String } - val x: Object { def t(): String } = new Object { - ^ -one error found diff --git a/test/files/neg/refine.scala b/test/files/neg/refine.scala deleted file mode 100644 index 5d175f26f5..0000000000 --- a/test/files/neg/refine.scala +++ /dev/null @@ -1,6 +0,0 @@ -object test { - - val x: Object { def t(): String } = new Object { - def t(): String = "1"; - } -} diff --git a/test/files/neg/vincent1.check b/test/files/neg/vincent1.check deleted file mode 100644 index a9f60e9ad2..0000000000 --- a/test/files/neg/vincent1.check +++ /dev/null @@ -1,7 +0,0 @@ -vincent1.scala:7: type x.type escapes its defining scope as part of scala.Object { type T = x.T } - class Functor(x: A) { type T = x.T } - ^ -vincent1.scala:9: type x.type escapes its defining scope as part of test.B { type T = x.T } - def functor(x: A): B { type T = x.T } = - ^ -two errors found diff --git a/test/files/neg/vincent1.scala b/test/files/neg/vincent1.scala deleted file mode 100644 index fb047305ff..0000000000 --- a/test/files/neg/vincent1.scala +++ /dev/null @@ -1,19 +0,0 @@ -object test { - - trait A { type T; } - - trait B { type T; } - - class Functor(x: A) { type T = x.T } - - def functor(x: A): B { type T = x.T } = - new B { - type T = x.T; - }; - - val a = new A { type T = String }; - val b = functor(a); - - val s: b.T = "coucou"; - -} diff --git a/test/files/pos/List1.scala b/test/files/pos/List1.scala deleted file mode 100644 index f0fce9501f..0000000000 --- a/test/files/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/files/pos/clsrefine.scala b/test/files/pos/clsrefine.scala deleted file mode 100644 index 56db9d4c13..0000000000 --- a/test/files/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/files/pos/compound.scala b/test/files/pos/compound.scala deleted file mode 100644 index 60890f9102..0000000000 --- a/test/files/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/files/pos/expressions-current.scala b/test/files/pos/expressions-current.scala index 207adb2b14..b343dbf68b 100644 --- a/test/files/pos/expressions-current.scala +++ b/test/files/pos/expressions-current.scala @@ -48,13 +48,13 @@ abstract class Lang2 extends Lang { object Main { def main(args: Array[String]) = { - val l1 = new Lang { type visitor = Visitor } + 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 }); - val l2 = new Lang2 { type visitor = Visitor2 } + 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 }); diff --git a/test/files/pos/matthias3.scala b/test/files/pos/matthias3.scala deleted file mode 100644 index 6e86afeca6..0000000000 --- a/test/files/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/files/pos/matthias5.scala b/test/files/pos/matthias5.scala deleted file mode 100644 index 0dcb7f833d..0000000000 --- a/test/files/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/files/pos/refine.scala b/test/files/pos/refine.scala deleted file mode 100644 index 255621ad43..0000000000 --- a/test/files/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/files/pos/scoping2.scala b/test/files/pos/scoping2.scala index 8fcd71bb8b..39f3ef5f0e 100644 --- a/test/files/pos/scoping2.scala +++ b/test/files/pos/scoping2.scala @@ -7,7 +7,7 @@ object That { type T <: J; trait J {} } - type C = A with B { + trait C extends A with B { type T <: I with J; } } diff --git a/test/files/pos/test4refine.scala b/test/files/pos/test4refine.scala deleted file mode 100644 index 6710962934..0000000000 --- a/test/files/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/files/pos/test5.scala b/test/files/pos/test5.scala index bc3a17c9be..4dbafc9ac3 100644 --- a/test/files/pos/test5.scala +++ b/test/files/pos/test5.scala @@ -14,7 +14,7 @@ object test { 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 {} + def chk_ip(p: P): Unit; // Value with type X as seen from instances of I def val_ix: X = val_ix; diff --git a/test/files/pos/test5refine.scala b/test/files/pos/test5refine.scala deleted file mode 100644 index 95670faa05..0000000000 --- a/test/files/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/files/pos/vincent.scala b/test/files/pos/vincent.scala deleted file mode 100644 index eed25eb84c..0000000000 --- a/test/files/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 - } - -} diff --git a/test/neg/bug44.check b/test/neg/bug44.check deleted file mode 100644 index 9347758ac9..0000000000 --- a/test/neg/bug44.check +++ /dev/null @@ -1,6 +0,0 @@ -bug44.scala:2: type mismatch; - found : scala.Object - required: scala.Object { def t: scala.Int } - var x: Object { def t: Int; } = new Object() { - ^ -one error found diff --git a/test/neg/bug44.scala b/test/neg/bug44.scala deleted file mode 100644 index 7989838250..0000000000 --- a/test/neg/bug44.scala +++ /dev/null @@ -1,5 +0,0 @@ -abstract class C { - var x: Object { def t: Int; } = new Object() { - def t: Int = 1; - } -} diff --git a/test/neg/refine.check b/test/neg/refine.check deleted file mode 100644 index 271451e65e..0000000000 --- a/test/neg/refine.check +++ /dev/null @@ -1,6 +0,0 @@ -refine.scala:3: type mismatch; - found : scala.Object - required: scala.Object { def t(): java.lang.String } - val x: Object { def t(): String } = new Object { - ^ -one error found diff --git a/test/neg/refine.scala b/test/neg/refine.scala deleted file mode 100644 index 5d175f26f5..0000000000 --- a/test/neg/refine.scala +++ /dev/null @@ -1,6 +0,0 @@ -object test { - - val x: Object { def t(): String } = new Object { - def t(): String = "1"; - } -} diff --git a/test/neg/vincent1.check b/test/neg/vincent1.check deleted file mode 100644 index a9f60e9ad2..0000000000 --- a/test/neg/vincent1.check +++ /dev/null @@ -1,7 +0,0 @@ -vincent1.scala:7: type x.type escapes its defining scope as part of scala.Object { type T = x.T } - class Functor(x: A) { type T = x.T } - ^ -vincent1.scala:9: type x.type escapes its defining scope as part of test.B { type T = x.T } - def functor(x: A): B { type T = x.T } = - ^ -two errors found diff --git a/test/neg/vincent1.scala b/test/neg/vincent1.scala deleted file mode 100644 index fb047305ff..0000000000 --- a/test/neg/vincent1.scala +++ /dev/null @@ -1,19 +0,0 @@ -object test { - - trait A { type T; } - - trait B { type T; } - - class Functor(x: A) { type T = x.T } - - def functor(x: A): B { type T = x.T } = - new B { - type T = x.T; - }; - - val a = new A { type T = String }; - val b = functor(a); - - val s: b.T = "coucou"; - -} 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/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/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/expressions-current.scala b/test/pos/expressions-current.scala index 207adb2b14..b343dbf68b 100644 --- a/test/pos/expressions-current.scala +++ b/test/pos/expressions-current.scala @@ -48,13 +48,13 @@ abstract class Lang2 extends Lang { object Main { def main(args: Array[String]) = { - val l1 = new Lang { type visitor = Visitor } + 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 }); - val l2 = new Lang2 { type visitor = Visitor2 } + 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 }); 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/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/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/scoping2.scala b/test/pos/scoping2.scala index 8fcd71bb8b..39f3ef5f0e 100644 --- a/test/pos/scoping2.scala +++ b/test/pos/scoping2.scala @@ -7,7 +7,7 @@ object That { type T <: J; trait J {} } - type C = A with B { + trait C extends A with B { type T <: I with J; } } 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 index bc3a17c9be..4dbafc9ac3 100644 --- a/test/pos/test5.scala +++ b/test/pos/test5.scala @@ -14,7 +14,7 @@ object test { 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 {} + def chk_ip(p: P): Unit; // Value with type X as seen from instances of I def val_ix: X = val_ix; 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/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 - } - -} -- cgit v1.2.3