File tree 2 files changed +6
-7
lines changed
compiler/src/dotty/tools/dotc 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 @@ -869,20 +869,19 @@ class Namer { typer: Typer =>
869
869
def registerIfChild (denot : SymDenotation )(implicit ctx : Context ): Unit = {
870
870
val sym = denot.symbol
871
871
872
- def register (child : Symbol , parent : Type ) = {
872
+ def register (child : Symbol , parent : Type ) =
873
873
val cls = parent.classSymbol
874
874
if cls.isEffectivelySealed
875
875
&& child.associatedFile == cls.associatedFile // don't register ad-hoc extensions as children
876
876
then
877
- if child.isInaccessibleChildOf(cls) && ! sym.hasAnonymousChild then
877
+ if ( child.isInaccessibleChildOf(cls) || child.isAnonymousClass ) && ! sym.hasAnonymousChild then
878
878
addChild(cls, cls)
879
879
else if ! cls.is(ChildrenQueried ) then
880
880
addChild(cls, child)
881
881
else
882
- ctx.error(em """ children of $cls were already queried before $sym was discovered.
882
+ ctx.error(em """ children of $cls were already queried before $sym / ${sym.ownersIterator.toList} was discovered.
883
883
|As a remedy, you could move $sym on the same nesting level as $cls. """ ,
884
884
child.sourcePos)
885
- }
886
885
887
886
if (denot.isClass && ! sym.isEnumAnonymClass && ! sym.isRefinementClass)
888
887
denot.asClass.classParents.foreach { parent =>
You can’t perform that action at this time.
0 commit comments