File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7024,7 +7024,6 @@ object Types extends TypeUtils {
7024
7024
class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
7025
7025
var seen = util.HashSet [Type ](initialCapacity = 8 )
7026
7026
def apply (n : Int , tp : Type ): Int =
7027
- seen += tp
7028
7027
tp match {
7029
7028
case tp : AppliedType =>
7030
7029
val tpNorm = tp.tryNormalize
@@ -7036,8 +7035,11 @@ object Types extends TypeUtils {
7036
7035
apply(n, tp.superType)
7037
7036
case tp : TypeParamRef =>
7038
7037
apply(n, TypeComparer .bounds(tp))
7039
- case tp : LazyRef if seen.contains(tp) =>
7040
- n
7038
+ case tp : LazyRef =>
7039
+ if seen.contains(tp) then n
7040
+ else
7041
+ seen += tp
7042
+ foldOver(n, tp)
7041
7043
case _ =>
7042
7044
foldOver(n, tp)
7043
7045
}
You can’t perform that action at this time.
0 commit comments