File tree 1 file changed +7
-3
lines changed
src/dotty/tools/dotc/core
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ object SymDenotations {
469
469
// for not doing this outright is speed. We would like to avoid
470
470
// creating a new context object each time we call accessWithin.
471
471
// Note that the exception should be thrown only infrequently.
472
- case ex : NotDefinedHere => test(ctx.withMode (Mode .FutureDefsOK ))
472
+ case ex : NotDefinedHere => test(ctx.addMode (Mode .FutureDefsOK ))
473
473
}
474
474
}
475
475
@@ -637,8 +637,12 @@ object SymDenotations {
637
637
/** The class containing this denotation.
638
638
* If this denotation is already a class, return itself
639
639
*/
640
- final def enclosingClass (implicit ctx : Context ): Symbol =
641
- if (isClass || ! exists) symbol else owner.enclosingClass
640
+ final def enclosingClass (implicit ctx : Context ): Symbol = {
641
+ def enclClass (d : SymDenotation ): Symbol =
642
+ if (d.isClass || ! d.exists) d.symbol else enclClass(d.owner)
643
+ val cls = enclClass(this )
644
+ if (this is InSuperCall ) cls.owner.enclosingClass else cls
645
+ }
642
646
643
647
final def isEffectivelyFinal (implicit ctx : Context ): Boolean = {
644
648
(this .flags is Flags .PrivateOrFinal ) || (! this .owner.isClass) ||
You can’t perform that action at this time.
0 commit comments