diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-30 13:26:54 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-30 13:26:54 +0200 |
commit | cdbe81e95cbf5e67fe4289b450440b63147f68ab (patch) | |
tree | aff000373fec696f9e42772189862231d269fc1c /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | b653007ed0f30298b44dcc67bf032c1d2d58bcaf (diff) | |
download | dotty-cdbe81e95cbf5e67fe4289b450440b63147f68ab.tar.gz dotty-cdbe81e95cbf5e67fe4289b450440b63147f68ab.tar.bz2 dotty-cdbe81e95cbf5e67fe4289b450440b63147f68ab.zip |
Fix #440: entering symbol into scope also enters it into future scopes.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 0a978f8c3..b042f2621 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1275,7 +1275,7 @@ object SymDenotations { myMemberCache } - /** Enter a symbol in current scope. + /** Enter a symbol in current scope, and future scopes of same denotation. * Note: We require that this does not happen after the first time * someone does a findMember on a subclass. * @param scope The scope in which symbol should be entered. @@ -1283,7 +1283,9 @@ object SymDenotations { */ def enter(sym: Symbol, scope: Scope = EmptyScope)(implicit ctx: Context): Unit = { val mscope = scope match { - case scope: MutableScope => scope + case scope: MutableScope => + assert(this.nextInRun == this) // we are not going to bring this symbol into future + scope case _ => unforcedDecls.openForMutations } if (this is PackageClass) { @@ -1295,6 +1297,10 @@ object SymDenotations { } } enterNoReplace(sym, mscope) + val nxt = this.nextInRun + if((nxt ne this) && (nxt.validFor.code > this.validFor.code)) { + this.nextInRun.asSymDenotation.asClass.enter(sym) + } } /** Enter a symbol in given `scope` without potentially replacing the old copy. */ |