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 @@ -6587,7 +6587,6 @@ object Types extends TypeUtils {
65876587 class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
65886588 var seen = util.HashSet [Type ](initialCapacity = 8 )
65896589 def apply (n : Int , tp : Type ): Int =
6590- seen += tp
65916590 tp match {
65926591 case tp : AppliedType =>
65936592 val tpNorm = tp.tryNormalize
@@ -6599,8 +6598,11 @@ object Types extends TypeUtils {
65996598 apply(n, tp.superType)
66006599 case tp : TypeParamRef =>
66016600 apply(n, TypeComparer .bounds(tp))
6602- case tp : LazyRef if seen.contains(tp) =>
6603- n
6601+ case tp : LazyRef =>
6602+ if seen.contains(tp) then n
6603+ else
6604+ seen += tp
6605+ foldOver(n, tp)
66046606 case _ =>
66056607 foldOver(n, tp)
66066608 }
You can’t perform that action at this time.
0 commit comments