Skip to content

Commit e88c5b7

Browse files
committed
Avoid round-trip through sourceModule in scalacLinkedClass.
The round-trip is useless, and causes issues with some Scala2-emitted modules that do not have module classes (seems to be related to modules inside traits).
1 parent 44de114 commit e88c5b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ object SymDenotations {
11531153

11541154
final def scalacLinkedClass(using Context): Symbol =
11551155
if (this.is(ModuleClass)) companionNamed(effectiveName.toTypeName)
1156-
else if (this.isClass) companionNamed(effectiveName.moduleClassName).sourceModule.moduleClass
1156+
else if (this.isClass) companionNamed(effectiveName.moduleClassName)
11571157
else NoSymbol
11581158

11591159
/** Find companion class symbol with given name, or NoSymbol if none exists.

0 commit comments

Comments
 (0)