@@ -2045,7 +2045,7 @@ object Types {
2045
2045
else {
2046
2046
if (isType) {
2047
2047
val res =
2048
- if (currentSymbol.is(ClassTypeParam )) argForParam(prefix, currentSymbol .paramVariance)
2048
+ if (currentSymbol.is(ClassTypeParam )) argForParam(prefix, symbol .paramVariance)
2049
2049
else prefix.lookupRefined(name)
2050
2050
if (res.exists) return res
2051
2051
if (Config .splitProjections)
@@ -4471,17 +4471,19 @@ object Types {
4471
4471
* If the expansion is a wildcard parameter reference, convert its
4472
4472
* underlying bounds to a range, otherwise return the expansion.
4473
4473
*/
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 {
4476
4478
case arg @ TypeRef (pre, _) if pre.isArgPrefixOf(arg.symbol) =>
4477
4479
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)
4480
4482
}
4481
- case TypeBounds (lo, hi) =>
4482
- range(lo, hi)
4483
+ case arg : TypeBounds => expandBounds(arg)
4483
4484
case arg => reapply(arg)
4484
4485
}
4486
+ }
4485
4487
4486
4488
/** Derived selection.
4487
4489
* @pre the (upper bound of) prefix `pre` has a member named `tp.name`.
@@ -4491,7 +4493,7 @@ object Types {
4491
4493
else pre match {
4492
4494
case Range (preLo, preHi) =>
4493
4495
val forwarded =
4494
- if (tp.symbol.is(ClassTypeParam )) expandParam(tp, preHi, tp.symbol.paramVariance )
4496
+ if (tp.symbol.is(ClassTypeParam )) expandParam(tp, preHi)
4495
4497
else tryWiden(tp, preHi)
4496
4498
forwarded.orElse(
4497
4499
range(super .derivedSelect(tp, preLo), super .derivedSelect(tp, preHi)))
0 commit comments