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 {
70247024 class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
70257025 var seen = util.HashSet [Type ](initialCapacity = 8 )
70267026 def apply (n : Int , tp : Type ): Int =
7027- seen += tp
70287027 tp match {
70297028 case tp : AppliedType =>
70307029 val tpNorm = tp.tryNormalize
@@ -7036,8 +7035,11 @@ object Types extends TypeUtils {
70367035 apply(n, tp.superType)
70377036 case tp : TypeParamRef =>
70387037 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)
70417043 case _ =>
70427044 foldOver(n, tp)
70437045 }
You can’t perform that action at this time.
0 commit comments