diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-04-26 03:03:22 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-04-26 03:03:22 -0700 |
commit | 5819b78c25c9cba25fc84018d3905fe265bb4e18 (patch) | |
tree | 40c26ea0a04b968e82b9c99013daf752a93cd439 /test/files | |
parent | f33af58f3b6538398da6974275099fb18560e92d (diff) | |
parent | 7b4e450e9b746a9289f6d429cdee73bffa5cd733 (diff) | |
download | scala-5819b78c25c9cba25fc84018d3905fe265bb4e18.tar.gz scala-5819b78c25c9cba25fc84018d3905fe265bb4e18.tar.bz2 scala-5819b78c25c9cba25fc84018d3905fe265bb4e18.zip |
Merge pull request #2430 from paulp/issue/4365
SI-4365 nondeterministic failure in asSeenFrom
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t4365/a_1.scala | 18 | ||||
-rw-r--r-- | test/files/pos/t4365/b_1.scala | 22 |
2 files changed, 40 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..6f3405b1ff --- /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, This]] + extends Seq[A] with GenSeqViewLike[A, Coll, This] +{ + + 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..e5b5687185 --- /dev/null +++ b/test/files/pos/t4365/b_1.scala @@ -0,0 +1,22 @@ +import scala.collection._ + +trait GenSeqViewLike[+A, + +Coll, + +This <: GenSeqView[A, Coll] with GenSeqViewLike[A, Coll, This]] +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 + } + } +} |