Skip to content

Commit 308ac10

Browse files
committed
Fix CG Predef module load.
1 parent 1ac5523 commit 308ac10

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler/src/dotty/tools/dotc/transform/linker/CollectSummaries.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,15 @@ class CollectSummaries extends MiniPhase { thisTransform =>
358358
val isInPredef =
359359
ctx.owner.ownersIterator.exists(owner => owner == defn.ScalaPredefModule || owner.companionModule == defn.ScalaPredefModule)
360360

361-
val loadPredefModule = if (!isInPredef && (repeatedArgsCalls.nonEmpty || tree.tpe.normalizedPrefix == defn.ScalaPredefModuleRef)) {
361+
val isMethodOnPredef = {
362+
val prefix = tree match {
363+
case Apply(fun: Ident, _) => fun.tpe.normalizedPrefix
364+
case _ => tree.tpe.normalizedPrefix
365+
}
366+
prefix == defn.ScalaPredefModuleRef
367+
}
368+
369+
val loadPredefModule = if (!isInPredef && (repeatedArgsCalls.nonEmpty || isMethodOnPredef)) {
362370
List(CallInfo(defn.ScalaPredefModuleRef, Nil, Nil, someThisCallInfo))
363371
} else {
364372
Nil

0 commit comments

Comments
 (0)