Skip to content

Commit 8b25cea

Browse files
committed
Revert #9673
Handle NoPrefix properly
1 parent 818e36c commit 8b25cea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Summarization.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,11 @@ object Summarization {
316316
if env.canIgnoreClass(cls) then Effects.empty
317317
else {
318318
val ctor = cls.primaryConstructor
319-
Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner))._2 +
320-
MethodCall(ThisRef()(ref), ctor)(ref)
319+
val prefixEff =
320+
if tref.prefix == NoPrefix then Effects.empty
321+
else Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner)).effs
322+
323+
prefixEff + MethodCall(ThisRef()(ref), ctor)(ref)
321324
}
322325
})
323326
}

0 commit comments

Comments
 (0)