diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-12-23 15:49:15 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-01-28 19:12:19 +0100 |
commit | 51a458efeeebfeed6c357d56cf8afe5b06e86724 (patch) | |
tree | f9ecc004ec43a08cc7247ef2f8784545ff32250c /compiler/src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | dc5ba9d2ba31b2fe27f5b967c9fb800bc9210a93 (diff) | |
download | dotty-51a458efeeebfeed6c357d56cf8afe5b06e86724.tar.gz dotty-51a458efeeebfeed6c357d56cf8afe5b06e86724.tar.bz2 dotty-51a458efeeebfeed6c357d56cf8afe5b06e86724.zip |
Workaround #1895: Bringing a symbol to a new run is broken
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/SymDenotations.scala | 10 |
1 files changed, 7 insertions, 3 deletions
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) } |