Skip to content

Commit 8ab7710

Browse files
committed
Updates following feedback.
1 parent f92773c commit 8ab7710

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)