scala/scala — pull request #3545 by retronym (2014-02-17 21:24:52+00:00)
Title: SI-8301 fix regression with refinement subtyping, wildcard type.

In the enclosed test case, the list of candidate implicit is
checked for eligibility with the view by:

pt = Test.sym.type => ?{def asFreeType: ?}
tp = (sym: Test.u.Symbol)Test.u.CompatibleSymbol
matchesPt(tp, pt)

This ends up in `TypeComparers#specializesSym`, which compares:

symLo = asFreeType: => Universe.this.TypeSymbol
symHi = asFreeType: ?

Before the regression in fada1ef6, that method called `isStable`
on both of these to make sure that `symLo` was as least as stable
as `symHi`. Both returned `false`, and, they matched.

After that refactoring, two calls were made. `isStable` *only*
checked for stability, and gave the same results as before.
But, the new check for volatility believes that the low symbol
was more volatile than the high, because `WildCardType` is treated
as non-volatile.

Really, it should have the same volatility as whatever it is
being compared to, so that these sort of comparisons yield true.

This commit ammends `specializesSym` to special case `symHi: ?`,
and ignore the volatilty gap in that case.

Review by @adriaanm, /cc @xeno-by