File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -184,9 +184,9 @@ class SymUtils(val self: Symbol) extends AnyVal {
184
184
def isAccessible (sym : Symbol ): Boolean =
185
185
sym == cls
186
186
|| sym == cls.owner
187
- || sym.owner. is(Package )
188
- || sym.owner. isType && isAccessible(sym.owner)
189
- ! isAccessible(self)
187
+ || sym.is(Package )
188
+ || sym.isType && isAccessible(sym.owner)
189
+ ! isAccessible(self.owner )
190
190
191
191
/** If this is a sealed class, its known children in the order of textual occurrence */
192
192
def children (implicit ctx : Context ): List [Symbol ] = {
Original file line number Diff line number Diff line change @@ -874,20 +874,19 @@ class Namer { typer: Typer =>
874
874
def registerIfChild (denot : SymDenotation )(implicit ctx : Context ): Unit = {
875
875
val sym = denot.symbol
876
876
877
- def register (child : Symbol , parent : Type ) = {
877
+ def register (child : Symbol , parent : Type ) =
878
878
val cls = parent.classSymbol
879
879
if cls.isEffectivelySealed
880
880
&& child.associatedFile == cls.associatedFile // don't register ad-hoc extensions as children
881
881
then
882
- if child.isInaccessibleChildOf(cls) && ! sym.hasAnonymousChild then
882
+ if ( child.isInaccessibleChildOf(cls) || child.isAnonymousClass ) && ! sym.hasAnonymousChild then
883
883
addChild(cls, cls)
884
884
else if ! cls.is(ChildrenQueried ) then
885
885
addChild(cls, child)
886
886
else
887
- ctx.error(em """ children of $cls were already queried before $sym was discovered.
887
+ ctx.error(em """ children of $cls were already queried before $sym / ${sym.ownersIterator.toList} was discovered.
888
888
|As a remedy, you could move $sym on the same nesting level as $cls. """ ,
889
889
child.sourcePos)
890
- }
891
890
892
891
if (denot.isClass && ! sym.isEnumAnonymClass && ! sym.isRefinementClass)
893
892
denot.asClass.classParents.foreach { parent =>
You can’t perform that action at this time.
0 commit comments