diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-29 20:37:38 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-29 20:40:20 +0200 |
commit | 290200037ba9633d1dc23dc02750c1396ee11045 (patch) | |
tree | 5694bd154d6947562dd3ef953f5d613c9822e72f /tests/pos/tangledCompanion.scala | |
parent | 9ab6ce7c351e428d09a690cc8c841f0750fe8973 (diff) | |
download | dotty-290200037ba9633d1dc23dc02750c1396ee11045.tar.gz dotty-290200037ba9633d1dc23dc02750c1396ee11045.tar.bz2 dotty-290200037ba9633d1dc23dc02750c1396ee11045.zip |
Index members of a class before evaluating its parents
Avoids missing member in tangledCompanion.scala, which is a minimization
of intermittent failures in CollectionStrawMan6. Intermittent, because it
depended on order of compilation. CollectionTests have to be compiled together with
but before CollectionStrawMan6 (this was _sometimes_ the case because partest did not
honor indicated compilation order so far). I.e.
dotc CollectionTests_2.scala CollectionStrawMan6_1.scala
would trigger the error. tangledCompanion.scala captures the dependencies
in a single file.
Diffstat (limited to 'tests/pos/tangledCompanion.scala')
-rw-r--r-- | tests/pos/tangledCompanion.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pos/tangledCompanion.scala b/tests/pos/tangledCompanion.scala new file mode 100644 index 000000000..5853f8675 --- /dev/null +++ b/tests/pos/tangledCompanion.scala @@ -0,0 +1,26 @@ +object Test { + + import Coll._ + import LazyList.#:: + + val xs = LazyList.Empty + +} + +object Coll { + + trait IterableFactory[+C[X]] + + class LazyList[+A](expr: => LazyList.Evaluated[A]) + + object LazyList extends IterableFactory[LazyList] { + + type Evaluated[+A] = Option[(A, LazyList[A])] + + object Empty extends LazyList[Nothing](None) + + object #:: { + def unapply[A](s: LazyList[A]): Evaluated[A] = ??? + } + } +} |