Skip to content

Commit fb1272c

Browse files
committed
fix #23043
1 parent 9f63495 commit fb1272c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,14 @@ class Namer { typer: Typer =>
150150
if (preExisting.isDefinedInCurrentRun || preExisting.lastKnownDenotation.is(Package))
151151
&& (!preExisting.lastKnownDenotation.is(Private) || preExisting.owner.is(Package))
152152
&& (!preExisting.lastKnownDenotation.isPackageObject
153-
|| preExisting.associatedFile != ctx.source.file)
153+
|| preExisting.associatedFile != ctx.source.file && preExisting.associatedFile != null)
154154
// isDefinedInCurrentRun does not work correctly for package objects, because
155155
// package objects are updated to the new run earlier than normal classes, everytime
156156
// some member of the enclosing package is accessed. Therefore, we use another
157157
// test: conflict if package objects have the same name but come from different
158158
// sources. See i9252.
159-
then conflict(preExisting)
159+
then
160+
conflict(preExisting)
160161

161162
def pkgObjs(pkg: Symbol) =
162163
pkg.denot.asInstanceOf[PackageClassDenotation].packageObjs.map(_.symbol)

0 commit comments

Comments
 (0)