Skip to content

Commit a00fb3f

Browse files
authored
Merge pull request #12608 from dotty-staging/refactor-heap
Refactor heap and cache outers
2 parents 85575cc + 9527eac commit a00fb3f

File tree

6 files changed

+247
-174
lines changed

6 files changed

+247
-174
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ class Checker extends MiniPhase {
4949
import semantic._
5050
val tpl = tree.rhs.asInstanceOf[Template]
5151
val thisRef = ThisRef(cls)
52-
val heap = Objekt(cls, fields = mutable.Map.empty)
53-
val res = eval(tpl, thisRef, cls)(using heap, ctx, Vector.empty)
52+
val obj = Objekt(cls, fields = mutable.Map.empty, outers = mutable.Map(cls -> Hot))
53+
given Promoted = Promoted.empty
54+
given Trace = Trace.empty
55+
heap.update(thisRef, obj)
56+
val res = eval(tpl, thisRef, cls)
5457
res.errors.foreach(_.issue)
5558
}
5659

0 commit comments

Comments
 (0)