Skip to content

Commit 17a1878

Browse files
committed
return back check to preExisting.isPackageObject
1 parent 36d5fbd commit 17a1878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Namer { typer: Typer =>
149149
val preExisting = owner.unforcedDecls.lookup(name)
150150
if (preExisting.isDefinedInCurrentRun || preExisting.lastKnownDenotation.is(Package))
151151
&& (!preExisting.lastKnownDenotation.is(Private) || preExisting.owner.is(Package))
152-
&& (!preExisting.lastKnownDenotation.is(Package)
152+
&& (!preExisting.lastKnownDenotation.is(Package) && !preExisting.lastKnownDenotation.isPackageObject
153153
|| 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

0 commit comments

Comments
 (0)