Skip to content

Commit

Permalink
Fix bug when restoring denotations in Recheck.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
odersky committed Sep 20, 2023
1 parent 56eb2d8 commit ddc4eb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/Recheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ abstract class Recheck extends Phase, SymTransformer:
/** Change any `ResetPrivate` flags back to `Private` */
def transformSym(symd: SymDenotation)(using Context): SymDenotation =
val sym = symd.symbol
if sym.isUpdatedAfter(preRecheckPhase) then atPhase(preRecheckPhase)(sym.denot)
if sym.isUpdatedAfter(preRecheckPhase)
then atPhase(preRecheckPhase)(sym.denot.copySymDenotation())
else symd

def run(using Context): Unit =
Expand Down

0 comments on commit ddc4eb8

Please sign in to comment.