Skip to content

Commit 82d042f

Browse files
committed
Make Denotation#bringForward more robost
Assertion failed before when printers were turned on during test pickling mode.
1 parent c26aa8f commit 82d042f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ object Denotations {
601601
*/
602602
private def bringForward()(implicit ctx: Context): SingleDenotation = this match {
603603
case denot: SymDenotation if ctx.stillValid(denot) =>
604-
assert(ctx.runId > validFor.runId, s"denotation $denot invalid in run ${ctx.runId}. ValidFor: $validFor")
604+
assert(ctx.runId > validFor.runId || ctx.settings.YtestPickler.value, // mixing test pickler with debug printing can travel back in time
605+
s"denotation $denot invalid in run ${ctx.runId}. ValidFor: $validFor")
605606
var d: SingleDenotation = denot
606607
do {
607608
d.validFor = Period(ctx.period.runId, d.validFor.firstPhaseId, d.validFor.lastPhaseId)

0 commit comments

Comments
 (0)