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 {
7046
7046
class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
7047
7047
var seen = util.HashSet [Type ](initialCapacity = 8 )
7048
7048
def apply (n : Int , tp : Type ): Int =
7049
- seen += tp
7050
7049
tp match {
7051
7050
case tp : AppliedType =>
7052
7051
val tpNorm = tp.tryNormalize
@@ -7058,8 +7057,11 @@ object Types extends TypeUtils {
7058
7057
apply(n, tp.superType)
7059
7058
case tp : TypeParamRef =>
7060
7059
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)
7063
7065
case _ =>
7064
7066
foldOver(n, tp)
7065
7067
}
You can’t perform that action at this time.
0 commit comments