diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-22 16:05:11 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:12:17 +0200 |
commit | 154f3511d52c6b748c03d97dd035f0ad79f9a355 (patch) | |
tree | 242ad2ae186bbe5ed84adf69436d5bf810f540cb /tests/pos | |
parent | 5ee7b9ed189d77fbf864c5558841f53750db2c30 (diff) | |
download | dotty-154f3511d52c6b748c03d97dd035f0ad79f9a355.tar.gz dotty-154f3511d52c6b748c03d97dd035f0ad79f9a355.tar.bz2 dotty-154f3511d52c6b748c03d97dd035f0ad79f9a355.zip |
Move failing test to pending.
The original IterableSelfRec is not syntactically legal after
the hk changes. I attempted to fix, but there's still a type error.
Need to investigate whether this is a true error or a bug.
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/IterableSelfRec.scala | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/pos/IterableSelfRec.scala b/tests/pos/IterableSelfRec.scala deleted file mode 100644 index bba7a82d2..000000000 --- a/tests/pos/IterableSelfRec.scala +++ /dev/null @@ -1,52 +0,0 @@ -package dotty.collection -package immutable - -import annotation.unchecked.uncheckedVariance - -trait Collection[T] { self => - type This <: Collection { type This <: self.This } - def companion: CollectionCompanion[This] -} - -trait Iterable[T] extends Collection[T] { self => - type This <: Iterable { type This <: self.This } - override def companion: IterableCompanion[This] = Iterable.asInstanceOf - - def iterator: Iterator[T] -} - -trait Seq[T] extends Iterable[T] { self => - type This <: Seq { type This <: self.This } - override def companion: IterableCompanion[This] = Seq.asInstanceOf - - def apply(x: Int): T -} - -abstract class CollectionCompanion[+CC <: Collection { type This <: CC }] - -abstract class IterableCompanion[+CC <: Iterable { type This <: CC }] extends CollectionCompanion[CC] { - def fromIterator[T](it: Iterator[T]): CC[T] - def map[T, U](xs: Iterable[T], f: T => U): CC[U] = - fromIterator(xs.iterator.map(f)) - def filter[T](xs: Iterable[T], p: T => Boolean): CC[T] = - fromIterator(xs.iterator.filter(p)) - def flatMap[T, U](xs: Iterable[T], f: T => TraversableOnce[U]): CC[U] = - fromIterator(xs.iterator.flatMap(f)) - - implicit def transformOps[T](xs: CC[T] @uncheckedVariance): TransformOps[CC, T] = ??? // new TransformOps[CC, T](xs) -} - -class TransformOps[+CC <: Iterable { type This <: CC }, T] (val xs: CC[T]) extends AnyVal { - def companion[T](xs: CC[T] @uncheckedVariance): IterableCompanion[CC] = xs.companion - def map[U](f: T => U): CC[U] = companion(xs).map(xs, f) - def filter(p: T => Boolean): CC[T] = companion(xs).filter(xs, p) - def flatMap[U](f: T => TraversableOnce[U]): CC[U] = companion(xs).flatMap(xs, f) -} - -object Iterable extends IterableCompanion[Iterable] { - def fromIterator[T](it: Iterator[T]): Iterable[T] = ??? -} -object Seq extends IterableCompanion[Seq] { - def fromIterator[T](it: Iterator[T]): Seq[T] = ??? -} - |