diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index aa3ae0c3c513..650b13b1dfcf 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -82,8 +82,9 @@ object Symbols { def retainsDefTree(using Context): Boolean = ctx.settings.YretainTrees.value || denot.owner.isTerm || // no risk of leaking memory after a run for these - denot.isOneOf(InlineOrProxy) || // need to keep inline info - ctx.settings.YcheckInit.value // initialization check + denot.isOneOf(InlineOrProxy) || // need to keep inline info + ctx.settings.YcheckInit.value || // initialization check + ctx.settings.YcheckInitGlobal.value // initialization check /** The last denotation of this symbol */ private var lastDenot: SymDenotation = _