diff options
Diffstat (limited to 'test/files/pos/t4365')
-rw-r--r-- | test/files/pos/t4365/a_1.scala | 18 | ||||
-rw-r--r-- | test/files/pos/t4365/b_1.scala | 24 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/files/pos/t4365/a_1.scala b/test/files/pos/t4365/a_1.scala new file mode 100644 index 0000000000..a24b57772d --- /dev/null +++ b/test/files/pos/t4365/a_1.scala @@ -0,0 +1,18 @@ +import scala.collection._ + +trait SeqViewLike[+A, + +Coll, + +This <: SeqView[A, Coll] with SeqViewLike[A, Coll, Nothing]] + extends Seq[A] with GenSeqViewLike[A, Coll, Nothing] +{ + + trait Transformed[+B] extends super[GenSeqViewLike].Transformed[B] + + abstract class AbstractTransformed[+B] extends Seq[B] with Transformed[B] { + def underlying: Coll = error("") + } + + trait Reversed extends Transformed[A] with super[GenSeqViewLike].Reversed + + protected def newReversed: Transformed[A] = new AbstractTransformed[A] with Reversed +} diff --git a/test/files/pos/t4365/b_1.scala b/test/files/pos/t4365/b_1.scala new file mode 100644 index 0000000000..e1423813f1 --- /dev/null +++ b/test/files/pos/t4365/b_1.scala @@ -0,0 +1,24 @@ +import scala.collection._ + +trait GenSeqView0[+A, +Coll] + +trait GenSeqViewLike[+A, + +Coll, + +This <: GenSeqView0[A, Coll] with GenSeqViewLike[A, Coll, Nothing]] +extends GenSeq[A] { +self => + + trait Transformed[+B] { + def length: Int = 0 + def apply(idx: Int): B = error("") + } + + trait Reversed extends Transformed[A] { + def iterator: Iterator[A] = createReversedIterator + + private def createReversedIterator: Iterator[A] = { + self.foreach(_ => ()) + null + } + } +} |