diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-13 09:47:11 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-13 09:47:11 +0200 |
commit | 606df6573f0d0323ba58d06e8af3c1aaf844b708 (patch) | |
tree | c6e8e55b7ccc758ecb21e6a59948e65014d53e74 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 401d2012f4c99b170dec99c1f7c4251dda0b20fd (diff) | |
download | dotty-606df6573f0d0323ba58d06e8af3c1aaf844b708.tar.gz dotty-606df6573f0d0323ba58d06e8af3c1aaf844b708.tar.bz2 dotty-606df6573f0d0323ba58d06e8af3c1aaf844b708.zip |
Fixing validity checking of denotations.
To get this to work, we need to store the name of a scope netry irectly in the entry. This is arguably the right model anyway. A symbol can have different denotations with different names, and it might exist under different names in different scopes. In the previous model once a symbol's name changed in some phase, all scopes referring to that symbol from previous phases would become invalid. Now, the symbol is still visible under its original name.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index d2be45444..a3f83da47 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -494,7 +494,8 @@ object SymDenotations { /** The top-level symbol containing this denotation. */ final def topLevelSym(implicit ctx: Context): Symbol = - if (owner is PackageClass) symbol else owner.topLevelSym + if ((this is PackageClass) || (owner is PackageClass)) symbol + else owner.topLevelSym /** The package containing this denotation */ final def enclosingPackage(implicit ctx: Context): Symbol = |