Skip to content

Commit 3e574d3

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 142ff5f commit 3e574d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ object SymDenotations {
12471247

12481248
final def scalacLinkedClass(using Context): Symbol =
12491249
if (this.is(ModuleClass)) companionNamed(effectiveName.toTypeName)
1250-
else if (this.isClass) companionNamed(effectiveName.moduleClassName).sourceModule.moduleClass
1250+
else if (this.isClass) companionNamed(effectiveName.moduleClassName)
12511251
else NoSymbol
12521252

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

0 commit comments

Comments
 (0)