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/files/pos | |
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/files/pos')
-rw-r--r-- | test/files/pos/cyclics.scala | 23 |
1 files changed, 21 insertions, 2 deletions
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 } +} |