@@ -4973,14 +4973,8 @@ object Types {
4973
4973
foldOver(n + 1 , tp)
4974
4974
case tp : TypeRef if tp.info.isTypeAlias =>
4975
4975
apply(n, tp.superType)
4976
- case tp : TermRef =>
4977
- apply(n, tp.underlying)
4978
4976
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))
4984
4978
case _ =>
4985
4979
foldOver(n, tp)
4986
4980
}
@@ -4998,16 +4992,13 @@ object Types {
4998
4992
foldOver(cs + sym, tp)
4999
4993
case tp : TypeRef if tp.info.isTypeAlias =>
5000
4994
apply(cs, tp.superType)
5001
- case tp : TypeRef if tp.prefix.isValueType =>
4995
+ case tp : TypeRef if sym.isClass =>
5002
4996
foldOver(cs + sym, tp)
5003
4997
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)
5005
5000
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))
5011
5002
case other =>
5012
5003
foldOver(cs, tp)
5013
5004
}
0 commit comments