Skip to content

Commit 039f84e

Browse files
authored
Merge pull request #9673 from dotty-staging/fix-9670
Fix #9670: handle local class in parent effects
2 parents 487e69d + dcd1ae7 commit 039f84e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ object Summarization {
309309
if (cls == defn.AnyClass || cls == defn.AnyValClass) Effects.empty
310310
else {
311311
val ctor = cls.primaryConstructor
312-
Summarization.analyze(tref.prefix, ref)._2 +
312+
Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner))._2 +
313313
MethodCall(ThisRef()(ref), ctor)(ref)
314314
}
315315
})

tests/init/crash/i9670.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
object Outer {
2+
def foo = {
3+
trait Mixin
4+
class E extends Mixin
5+
object SomeObject {
6+
val A = E()
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)