@@ -2045,7 +2045,7 @@ object Types {
20452045 else {
20462046 if (isType) {
20472047 val res =
2048- if (currentSymbol.is(ClassTypeParam )) argForParam(prefix, currentSymbol .paramVariance)
2048+ if (currentSymbol.is(ClassTypeParam )) argForParam(prefix, symbol .paramVariance)
20492049 else prefix.lookupRefined(name)
20502050 if (res.exists) return res
20512051 if (Config .splitProjections)
@@ -4471,17 +4471,19 @@ object Types {
44714471 * If the expansion is a wildcard parameter reference, convert its
44724472 * underlying bounds to a range, otherwise return the expansion.
44734473 */
4474- def expandParam (tp : NamedType , pre : Type , variance : Int ): Type =
4475- tp.argForParam(pre, variance) match {
4474+ def expandParam (tp : NamedType , pre : Type ): Type = {
4475+ def expandBounds (tp : TypeBounds ) =
4476+ range(atVariance(- variance)(reapply(tp.lo)), reapply(tp.hi))
4477+ tp.argForParam(pre, tp.symbol.paramVariance) match {
44764478 case arg @ TypeRef (pre, _) if pre.isArgPrefixOf(arg.symbol) =>
44774479 arg.info match {
4478- case TypeBounds (lo, hi) => range(atVariance( - variance)(reapply(lo)), reapply(hi) )
4479- case arg => reapply(arg)
4480+ case argInfo : TypeBounds => expandBounds(argInfo )
4481+ case argInfo => reapply(arg)
44804482 }
4481- case TypeBounds (lo, hi) =>
4482- range(lo, hi)
4483+ case arg : TypeBounds => expandBounds(arg)
44834484 case arg => reapply(arg)
44844485 }
4486+ }
44854487
44864488 /** Derived selection.
44874489 * @pre the (upper bound of) prefix `pre` has a member named `tp.name`.
@@ -4491,7 +4493,7 @@ object Types {
44914493 else pre match {
44924494 case Range (preLo, preHi) =>
44934495 val forwarded =
4494- if (tp.symbol.is(ClassTypeParam )) expandParam(tp, preHi, tp.symbol.paramVariance )
4496+ if (tp.symbol.is(ClassTypeParam )) expandParam(tp, preHi)
44954497 else tryWiden(tp, preHi)
44964498 forwarded.orElse(
44974499 range(super .derivedSelect(tp, preLo), super .derivedSelect(tp, preHi)))
0 commit comments