scala/scala — pull request #1122 by paulp (2012-08-11 18:11:22+00:00)
Title: Improvement for SI-2251, failure to lub f-bounds.

After a great struggle, I realized that the major reason that
code like this still doesn't compile:

List(Stream(), List())

is that we were poisoning the computed lub in mergePrefixAndArgs by
throwing in Any when the max recursion depth was reached. I modified
it to return NoType instead, which allowed me to teach lublist to
recognize what has happened and fall back to a weaker type, one
which does not contain recursive bounds. This enables the lubbing
process to complete. The most elusive lub, defeated. Notice also
that the refinement members are correctly parameterized on Nothing,
rather than on Any as has often been the case.

(Re: Any/Nothing, see the change to test/files/run/lub-visibility.check.)

scala> List(Stream(), List())
res0: List[scala.collection.immutable.LinearSeq[Nothing] with scala.collection.AbstractSeq[Nothing]{def companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.LinearSeq with scala.collection.AbstractSeq]; def reverse: scala.collection.immutable.LinearSeq[Nothing] with scala.collection.AbstractSeq[Nothing]{def companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.LinearSeq with scala.collection.AbstractSeq]; def reverse: scala.collection.immutable.LinearSeq[Nothing] with scala.collection.AbstractSeq[Nothing]{def reverse: scala.collection.immutable.LinearSeq[Nothing] with scala.collection.AbstractSeq[Nothing]; def dropRight(n: Int): scala.collection.immutable.LinearSeq[Nothing] with scala.collection.AbstractSeq[Nothing]; def takeRight(n: ...