From 51a458efeeebfeed6c357d56cf8afe5b06e86724 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Fri, 23 Dec 2016 15:49:15 +0100 Subject: Workaround #1895: Bringing a symbol to a new run is broken --- compiler/src/dotty/tools/dotc/core/SymDenotations.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core/SymDenotations.scala') diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index aaae78c57..a3475e14c 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -45,9 +45,13 @@ trait SymDenotations { this: Context => else { val initial = denot.initial val firstPhaseId = initial.validFor.firstPhaseId.max(ctx.typerPhase.id) - if ((initial ne denot) || ctx.phaseId != firstPhaseId) - ctx.withPhase(firstPhaseId).stillValidInOwner(initial) - else + if ((initial ne denot) || ctx.phaseId != firstPhaseId) { + ctx.withPhase(firstPhaseId).stillValidInOwner(initial) || + // Workaround #1895: A symbol might not be entered into an owner + // until the second phase where it exists + (denot.validFor.containsPhaseId(firstPhaseId + 1)) && + ctx.withPhase(firstPhaseId + 1).stillValidInOwner(initial) + } else stillValidInOwner(denot) } -- cgit v1.2.3