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 @@ -7046,7 +7046,6 @@ object Types extends TypeUtils {
70467046 class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
70477047 var seen = util.HashSet [Type ](initialCapacity = 8 )
70487048 def apply (n : Int , tp : Type ): Int =
7049- seen += tp
70507049 tp match {
70517050 case tp : AppliedType =>
70527051 val tpNorm = tp.tryNormalize
@@ -7058,8 +7057,11 @@ object Types extends TypeUtils {
70587057 apply(n, tp.superType)
70597058 case tp : TypeParamRef =>
70607059 apply(n, TypeComparer .bounds(tp))
7061- case tp : LazyRef if seen.contains(tp) =>
7062- n
7060+ case tp : LazyRef =>
7061+ if seen.contains(tp) then n
7062+ else
7063+ seen += tp
7064+ foldOver(n, tp)
70637065 case _ =>
70647066 foldOver(n, tp)
70657067 }
You can’t perform that action at this time.
0 commit comments