Skip to content

Commit a71210b

Browse files
committed
Extract effectiveOwner
1 parent 95145a2 commit a71210b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,13 @@ trait Checking {
885885
* that is concurrently compiled in another source file.
886886
*/
887887
def checkNoModuleClash(sym: Symbol)(using Context): Unit =
888-
if sym.effectiveOwner.is(Package)
889-
&& sym.effectiveOwner.info.member(sym.name.moduleClassName).symbol.isAbsent()
888+
val effectiveOwner = sym.effectiveOwner
889+
if effectiveOwner.is(Package)
890+
&& effectiveOwner.info.member(sym.name.moduleClassName).symbol.isAbsent()
890891
then
891-
val conflicting = sym.effectiveOwner.info.member(sym.name.toTypeName).symbol
892+
val conflicting = effectiveOwner.info.member(sym.name.toTypeName).symbol
892893
if conflicting.exists then
893-
report.error(AlreadyDefined(sym.name, sym.effectiveOwner, conflicting), sym.srcPos)
894+
report.error(AlreadyDefined(sym.name, effectiveOwner, conflicting), sym.srcPos)
894895

895896
/** Check that `tp` is a class type.
896897
* Also, if `traitReq` is true, check that `tp` is a trait.

0 commit comments

Comments
 (0)