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 {
6587
6587
class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
6588
6588
var seen = util.HashSet [Type ](initialCapacity = 8 )
6589
6589
def apply (n : Int , tp : Type ): Int =
6590
- seen += tp
6591
6590
tp match {
6592
6591
case tp : AppliedType =>
6593
6592
val tpNorm = tp.tryNormalize
@@ -6599,8 +6598,11 @@ object Types extends TypeUtils {
6599
6598
apply(n, tp.superType)
6600
6599
case tp : TypeParamRef =>
6601
6600
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)
6604
6606
case _ =>
6605
6607
foldOver(n, tp)
6606
6608
}
You can’t perform that action at this time.
0 commit comments