Skip to content

Commit 341bbd7

Browse files
committed
Fix ensureFreshScopeAfter always cloning scope
`classInfo(prevCtx)` does not reload the denotation at `prevCtx`, so the if condition always returned true.
1 parent b7be521 commit 341bbd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,8 +1756,9 @@ object SymDenotations {
17561756
if (ctx.phaseId != phase.next.id) ensureFreshScopeAfter(phase)(ctx.withPhase(phase.next))
17571757
else {
17581758
val prevCtx = ctx.withPhase(phase)
1759+
val prevClassInfo = current(prevCtx).asInstanceOf[ClassDenotation].classInfo(prevCtx)
17591760
val ClassInfo(pre, _, ps, decls, selfInfo) = classInfo
1760-
if (classInfo(prevCtx).decls eq decls)
1761+
if (prevClassInfo.decls eq decls)
17611762
copySymDenotation(info = ClassInfo(pre, classSymbol, ps, decls.cloneScope, selfInfo))
17621763
.copyCaches(this, phase.next)
17631764
.installAfter(phase)

0 commit comments

Comments
 (0)