Skip to content

Commit 2334a0d

Browse files
committed
Revert scala#9673
Handle NoPrefix properly
1 parent d90dce2 commit 2334a0d

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
@@ -338,8 +338,11 @@ object Summarization {
338338
if (cls == defn.AnyClass || cls == defn.AnyValClass) Effects.empty
339339
else {
340340
val ctor = cls.primaryConstructor
341-
Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner))._2 +
342-
MethodCall(ThisRef()(ref), ctor)(ref)
341+
val prefixEff =
342+
if tref.prefix == NoPrefix then Effects.empty
343+
else Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner)).effs
344+
345+
prefixEff + MethodCall(ThisRef()(ref), ctor)(ref)
343346
}
344347
})
345348
}

0 commit comments

Comments
 (0)