Skip to content

Commit e905cd5

Browse files
committed
Fix compilation
1 parent 7ee58a3 commit e905cd5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,15 @@ object Semantic {
363363
* 4. Reset last cache.
364364
*/
365365
def prepareForNextClass()(using Context) =
366-
if this.changed then
367-
this.changed = false
368-
else
369-
this.commitToStableCache()
370-
this.heapStable = this.heap
366+
if this.changed then
367+
this.changed = false
368+
this.heap = this.heapStable
369+
else
370+
this.commitToStableCache()
371+
this.heapStable = this.heap
371372

372-
this.last = mutable.Map.empty
373+
this.last = mutable.Map.empty
374+
this.current = mutable.Map.empty
373375

374376
def updateObject(ref: Ref, obj: Objekt) =
375377
assert(!this.heapStable.contains(ref))
@@ -951,20 +953,20 @@ object Semantic {
951953
*
952954
* This method should only be called from the work list scheduler.
953955
*/
954-
private def doTask(task: Task)(using Cache, Context): Unit = log("checking " + task) {
956+
private def doTask(task: Task)(using Cache, Context): Unit = {
955957
val thisRef = task.value
956958
val tpl = thisRef.klass.defTree.asInstanceOf[TypeDef].rhs.asInstanceOf[Template]
957959

958960
val paramValues = tpl.constr.termParamss.flatten.map(param => param.symbol -> Hot).toMap
959961

960-
given Promoted = Promoted.empty
961-
given Trace = Trace.empty
962-
given Env = Env(paramValues)
963-
964962
@tailrec
965963
def iterate(): Unit = {
964+
given Promoted = Promoted.empty
965+
given Trace = Trace.empty
966+
given Env = Env(paramValues)
967+
966968
thisRef.ensureFresh()
967-
val res = eval(tpl, thisRef, thisRef.klass)
969+
val res = log("checking " + task) { eval(tpl, thisRef, thisRef.klass) }
968970
res.errors.foreach(_.issue)
969971

970972
if cache.hasChanged && res.errors.isEmpty then

0 commit comments

Comments
 (0)