diff options
author | Martin Odersky <odersky@gmail.com> | 2009-02-16 14:56:54 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-02-16 14:56:54 +0000 |
commit | c25ec632d37c8c676e72da5ae792d02be7583232 (patch) | |
tree | bf8711d91d99ca7acb8b10b98c15cb8d92a3edd6 /test | |
parent | dd368937571ef308989e1388b08e04f55b0b6cd4 (diff) | |
download | scala-c25ec632d37c8c676e72da5ae792d02be7583232.tar.gz scala-c25ec632d37c8c676e72da5ae792d02be7583232.tar.bz2 scala-c25ec632d37c8c676e72da5ae792d02be7583232.zip |
hopefully fixed the build by fixing deSkolemize...
hopefully fixed the build by fixing deSkolemize, and adapting the new
collection libraries to stricter override checking.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/bug692.check | 16 | ||||
-rw-r--r-- | test/files/pos/cyclics.scala | 23 | ||||
-rw-r--r-- | test/files/run/constrained-types.check | 2 |
3 files changed, 30 insertions, 11 deletions
diff --git a/test/files/neg/bug692.check b/test/files/neg/bug692.check index 099a261f42..14df1917d9 100644 --- a/test/files/neg/bug692.check +++ b/test/files/neg/bug692.check @@ -1,19 +1,19 @@ bug692.scala:3: error: not found: type T - trait Type[T0] extends Type0[T];
+ trait Type[T0] extends Type0[T]; ^ bug692.scala:10: error: class Foo takes type parameters - case class FooType() extends ClassType[Foo,AnyRef](ObjectType());
+ case class FooType() extends ClassType[Foo,AnyRef](ObjectType()); ^ bug692.scala:13: error: class Foo takes type parameters - case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
+ case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType); ^ bug692.scala:13: error: class Foo takes type parameters - case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
+ case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType); ^ -bug692.scala:19: error: class Foo takes type parameters - class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo;
- ^ bug692.scala:14: error: class Foo takes type parameters - implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] =
+ implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] = ^ +bug692.scala:19: error: class Foo takes type parameters + class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo; + ^ 6 errors found diff --git a/test/files/pos/cyclics.scala b/test/files/pos/cyclics.scala index 69092ce7ab..a49f4faaca 100644 --- a/test/files/pos/cyclics.scala +++ b/test/files/pos/cyclics.scala @@ -1,7 +1,26 @@ trait Param[T] trait Abs { type T } trait Cyclic1[A <: Param[A]] // works -trait Cyclic2[A <: Abs { type T <: A }] // fails -trait Cyclic3 { type A <: Abs { type T = A } } // fails +trait Cyclic2[A <: Abs { type T <: A }] +trait Cyclic3 { type A <: Abs { type T = A } } trait Cyclic4 { type A <: Param[A] } // works +trait Cyclic5 { type AA <: Abs; type A <: AA { type T = A } } + +trait IterableTemplate { + type Elem + type Constr <: IterableTemplate + type ConstrOf[A] = Constr { type Elem = A } + + def elements: Iterator[Elem] + + def map [B] (f: Elem => B): ConstrOf[B] + + def foreach(f: Elem => Unit) = elements.foreach(f) +} + + +trait Iterable[A] extends IterableTemplate { self => + type Elem + type Constr <: Iterable[A] { type Constr <: Iterable.this.Constr } +} diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check index c8f0a83ad3..d3c32b7a02 100644 --- a/test/files/run/constrained-types.check +++ b/test/files/run/constrained-types.check @@ -85,7 +85,7 @@ defined class peer ----- class NPE[T <: NPE[T] @peer] // should not crash -error: illegal cyclic reference involving class NPE +defined class NPE ----- def m = { |