aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-13 11:21:37 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-13 11:22:49 +0200
commitdeaa0d8bdcd5592e124acfbca1a1414365b667d7 (patch)
treea6b2bd63b05db7cae6c4b588cf406b9076a1bcb3 /src/dotty/tools/dotc/core/Denotations.scala
parentab8ee535fc2f16f3ece55326e58dec6171614829 (diff)
downloaddotty-deaa0d8bdcd5592e124acfbca1a1414365b667d7.tar.gz
dotty-deaa0d8bdcd5592e124acfbca1a1414365b667d7.tar.bz2
dotty-deaa0d8bdcd5592e124acfbca1a1414365b667d7.zip
Package denotations are never transformed
Packages should always have a single denotation, which is invariant for all transformations. Package members should always be entered in the first phase, and should never be entered after a given phase. This reflects the fact that package members correspond to classfiles. Once you create a classfile, it stays around and is available from the start of the next run. Also, we need to prevent multiple denotation versions of packages from hanging on to stale symbols. It would not be enough to replace a package member by a newly compiled one; if packages had multiple denotations we'd have to do this for all of them.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index dceec47a2..fa2292c60 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -553,7 +553,9 @@ object Denotations {
startPid = cur.validFor.firstPhaseId
else {
next match {
- case next: ClassDenotation => next.resetFlag(Frozen)
+ case next: ClassDenotation =>
+ assert(!next.is(Package), s"illegal transfomation of package denotation by transformer ${ctx.withPhase(transformer).phase}")
+ next.resetFlag(Frozen)
case _ =>
}
next.nextInRun = cur.nextInRun