Skip to content

Commit ddc4eb8

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. The bug was observed when compiling stdlib under new capture checking implementation. # Conflicts: # compiler/src/dotty/tools/dotc/transform/Recheck.scala
1 parent 56eb2d8 commit ddc4eb8

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
@@ -153,7 +153,8 @@ abstract class Recheck extends Phase, SymTransformer:
153153
/** Change any `ResetPrivate` flags back to `Private` */
154154
def transformSym(symd: SymDenotation)(using Context): SymDenotation =
155155
val sym = symd.symbol
156-
if sym.isUpdatedAfter(preRecheckPhase) then atPhase(preRecheckPhase)(sym.denot)
156+
if sym.isUpdatedAfter(preRecheckPhase)
157+
then atPhase(preRecheckPhase)(sym.denot.copySymDenotation())
157158
else symd
158159

159160
def run(using Context): Unit =

0 commit comments

Comments
 (0)