@@ -4973,14 +4973,8 @@ object Types {
49734973 foldOver(n + 1 , tp)
49744974 case tp : TypeRef if tp.info.isTypeAlias =>
49754975 apply(n, tp.superType)
4976- case tp : TermRef =>
4977- apply(n, tp.underlying)
49784976 case tp : TypeParamRef =>
4979- ctx.typerState.constraint.entry(tp) match {
4980- case tb : TypeBounds => foldOver(n, tb)
4981- case NoType => foldOver(n, tp.underlying)
4982- case inst => foldOver(n, inst)
4983- }
4977+ apply(n, ctx.typeComparer.bounds(tp))
49844978 case _ =>
49854979 foldOver(n, tp)
49864980 }
@@ -4998,16 +4992,13 @@ object Types {
49984992 foldOver(cs + sym, tp)
49994993 case tp : TypeRef if tp.info.isTypeAlias =>
50004994 apply(cs, tp.superType)
5001- case tp : TypeRef if tp.prefix.isValueType =>
4995+ case tp : TypeRef if sym.isClass =>
50024996 foldOver(cs + sym, tp)
50034997 case tp : TermRef =>
5004- apply(cs, tp.underlying)
4998+ val tsym = if (tp.termSymbol.is(Param )) tp.underlying.typeSymbol else tp.termSymbol
4999+ foldOver(cs + tsym, tp)
50055000 case tp : TypeParamRef =>
5006- ctx.typerState.constraint.entry(tp) match {
5007- case tb : TypeBounds => foldOver(cs, tb)
5008- case NoType => foldOver(cs, tp.underlying)
5009- case inst => foldOver(cs, inst)
5010- }
5001+ apply(cs, ctx.typeComparer.bounds(tp))
50115002 case other =>
50125003 foldOver(cs, tp)
50135004 }
0 commit comments