scala/scala — pull request #3526 by retronym (2014-02-13 20:59:11+00:00)
Title: SI-8276 Test for cyclic error caused by (reverted) SI-1786 fix

We reverted SI-1786 recently on the grounds that its means of
avoiding cycles (not sharpening bounds of T[_] when T is
uninitialized) caused unacceptable non-determinism (well:
compilation order dependency) to type inference.

Nary a day later, @gkossakowski hit a regression in scala-io.
Bisection revealed that it stopped working in 2dbd17a2 and
started working agiain after the revert. How's that for
prescience!

I've distilled the cyclic error in scala-io in this test
case.

I'm yet to pinpoint this, followon error, which didn't survive
the shrink ray, and only appeared in the original code:

error: java.lang.IndexOutOfBoundsException: 0
at scala.collection.LinearSeqOptimized$class.apply(LinearSeqOptimized.scala:51)
at scala.collection.immutable.List.apply(List.scala:83)
at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.correspondingTypeArgument(TypeMaps.scala:5

Review by @gkossakowski.

/cc @adriaanm (it will make a good test case for the alternative
approach you're trying.)