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 {
184184 def isAccessible (sym : Symbol ): Boolean =
185185 sym == cls
186186 || 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 )
190190
191191 /** If this is a sealed class, its known children in the order of textual occurrence */
192192 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 =>
874874 def registerIfChild (denot : SymDenotation )(implicit ctx : Context ): Unit = {
875875 val sym = denot.symbol
876876
877- def register (child : Symbol , parent : Type ) = {
877+ def register (child : Symbol , parent : Type ) =
878878 val cls = parent.classSymbol
879879 if cls.isEffectivelySealed
880880 && child.associatedFile == cls.associatedFile // don't register ad-hoc extensions as children
881881 then
882- if child.isInaccessibleChildOf(cls) && ! sym.hasAnonymousChild then
882+ if ( child.isInaccessibleChildOf(cls) || child.isAnonymousClass ) && ! sym.hasAnonymousChild then
883883 addChild(cls, cls)
884884 else if ! cls.is(ChildrenQueried ) then
885885 addChild(cls, child)
886886 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.
888888 |As a remedy, you could move $sym on the same nesting level as $cls. """ ,
889889 child.sourcePos)
890- }
891890
892891 if (denot.isClass && ! sym.isEnumAnonymClass && ! sym.isRefinementClass)
893892 denot.asClass.classParents.foreach { parent =>
You can’t perform that action at this time.
0 commit comments