Skip to content

Commit 1576b11

Browse files
committed
Fix bug when restoring denotations in Recheck.
Need to copy the denotation, since denotations come with next pointers which would get scrambled otherwise.
1 parent cf3b8ae commit 1576b11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ abstract class Recheck extends Phase, SymTransformer:
158158
val sym = symd.symbol
159159
def updatedAfter(p: Phase): Boolean =
160160
sym.isUpdatedAfter(p) || p != preRecheckPhase && updatedAfter(p.next)
161-
if updatedAfter(firstPrepPhase) then atPhase(firstPrepPhase)(sym.denot)
161+
if updatedAfter(firstPrepPhase)
162+
then atPhase(firstPrepPhase)(sym.denot.copySymDenotation())
162163
else symd
163164

164165
def run(using Context): Unit =

0 commit comments

Comments
 (0)