File tree 2 files changed +9
-3
lines changed
src/dotty/tools/dotc/core
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -471,7 +471,7 @@ object Denotations {
471
471
* 2) the union of all validity periods is a contiguous
472
472
* interval.
473
473
*/
474
- private var nextInRun : SingleDenotation = this
474
+ protected var nextInRun : SingleDenotation = this
475
475
476
476
/** The version of this SingleDenotation that was valid in the first phase
477
477
* of this run.
Original file line number Diff line number Diff line change @@ -1275,15 +1275,17 @@ object SymDenotations {
1275
1275
myMemberCache
1276
1276
}
1277
1277
1278
- /** Enter a symbol in current scope.
1278
+ /** Enter a symbol in current scope, and future scopes of same denotation .
1279
1279
* Note: We require that this does not happen after the first time
1280
1280
* someone does a findMember on a subclass.
1281
1281
* @param scope The scope in which symbol should be entered.
1282
1282
* If this is EmptyScope, the scope is `decls`.
1283
1283
*/
1284
1284
def enter (sym : Symbol , scope : Scope = EmptyScope )(implicit ctx : Context ): Unit = {
1285
1285
val mscope = scope match {
1286
- case scope : MutableScope => scope
1286
+ case scope : MutableScope =>
1287
+ assert(this .nextInRun == this ) // we are not going to bring this symbol into future
1288
+ scope
1287
1289
case _ => unforcedDecls.openForMutations
1288
1290
}
1289
1291
if (this is PackageClass ) {
@@ -1295,6 +1297,10 @@ object SymDenotations {
1295
1297
}
1296
1298
}
1297
1299
enterNoReplace(sym, mscope)
1300
+ val nxt = this .nextInRun
1301
+ if ((nxt ne this ) && (nxt.validFor.code > this .validFor.code)) {
1302
+ this .nextInRun.asSymDenotation.asClass.enter(sym)
1303
+ }
1298
1304
}
1299
1305
1300
1306
/** Enter a symbol in given `scope` without potentially replacing the old copy. */
You can’t perform that action at this time.
0 commit comments