File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
438438 val found =
439439 if owner.is(Package ) then
440440 owner.denot.asClass.membersNamed(name)
441- .filterWithPredicate(d => ! d.symbol.is(Package ) && d.symbol.source == denot.symbol.source)
441+ .filterWithPredicate(d => ! d.symbol.is(Package )
442+ && denot.symbol.source.exists
443+ && d.symbol.source == denot.symbol.source)
442444 else
443445 val scope = if owner.isClass then owner.info.decls else outer.scope
444446 scope.denotsNamed(name)
@@ -479,7 +481,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
479481 result = checkNewOrShadowed(found, Definition ) // no need to go further out, we found highest prec entry
480482 found match
481483 case found : NamedType
482- if curOwner.isClass && isInherited(found.denot) && ! ctx.compilationUnit.isJava =>
484+ if curOwner.isClass && found.denot.exists && isInherited(found.denot) && ! ctx.compilationUnit.isJava =>
483485 checkNoOuterDefs(found.denot, ctx, ctx)
484486 case _ =>
485487 else
Original file line number Diff line number Diff line change 1+ package p
2+
3+ object Value
Original file line number Diff line number Diff line change 1+ package p
2+
3+ object B extends Enumeration {
4+ val A = Value
5+ }
You can’t perform that action at this time.
0 commit comments