Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only track types in from LazyRef
[Cherry-picked 8a0bbdf]
  • Loading branch information
eejbyfeldt authored and tgodzik committed Sep 26, 2025
commit 39b3db3738bde35d2f8cfc96b92d38c2b59ba60b
8 changes: 5 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6587,7 +6587,6 @@ object Types extends TypeUtils {
class TypeSizeAccumulator(using Context) extends TypeAccumulator[Int] {
var seen = util.HashSet[Type](initialCapacity = 8)
def apply(n: Int, tp: Type): Int =
seen += tp
tp match {
case tp: AppliedType =>
val tpNorm = tp.tryNormalize
Expand All @@ -6599,8 +6598,11 @@ object Types extends TypeUtils {
apply(n, tp.superType)
case tp: TypeParamRef =>
apply(n, TypeComparer.bounds(tp))
case tp: LazyRef if seen.contains(tp) =>
n
case tp: LazyRef =>
if seen.contains(tp) then n
else
seen += tp
foldOver(n, tp)
case _ =>
foldOver(n, tp)
}
Expand Down