Skip to content

Commit 87f375c

Browse files
committed
Guard against completions in wrong runs
We get sometimes stake symbol error because a completer is run in its creation context, which comes from a previous run. This should not happen. Adding an assert to flag the erronenous completion when it happens.
1 parent e5b891a commit 87f375c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ class Namer { typer: Typer =>
756756
else levels(c.outer) + 1
757757
completions.println(s"!!!completing ${denot.symbol.showLocated} in buried typerState, gap = ${levels(ctx)}")
758758
}
759+
assert(ctx.runId == creationContext.runId, "completing $denot in wrong run ${ctx.runId}, was created in ${creationContext.runId}")
759760
completeInCreationContext(denot)
760761
}
761762

0 commit comments

Comments
 (0)