@@ -83,7 +83,8 @@ object Semantic {
83
83
}
84
84
85
85
/** A reference to the object under initialization pointed by `this` */
86
- case class ThisRef (klass : ClassSymbol , outer : Value , ctor : Symbol , args : List [Value ]) extends Ref {
86
+ case class ThisRef (klass : ClassSymbol ) extends Ref {
87
+ val outer = Hot
87
88
/** Caches initialized fields */
88
89
val objekt = Objekt (klass, fields = mutable.Map .empty, outers = mutable.Map (klass -> outer))
89
90
}
@@ -709,7 +710,7 @@ object Semantic {
709
710
cls == defn.ObjectClass
710
711
711
712
// ----- Work list ---------------------------------------------------
712
- case class Task ( value : ThisRef )( val trace : Trace )
713
+ type Task = ThisRef
713
714
714
715
class WorkList private [Semantic ]() {
715
716
private var checkedTasks : Set [Task ] = Set .empty
@@ -734,12 +735,14 @@ object Semantic {
734
735
* This method should only be called from the work list scheduler.
735
736
*/
736
737
private def doTask (task : Task )(using State , Context ): Unit = {
737
- val thisRef = task.value
738
+ val thisRef = task
738
739
val tpl = thisRef.klass.defTree.asInstanceOf [TypeDef ].rhs.asInstanceOf [Template ]
739
740
741
+ val paramValues = tpl.constr.termParamss.flatten.map(param => param.symbol -> Hot ).toMap
742
+
740
743
given Promoted = Promoted .empty
741
- given Trace = task.trace
742
- given Env = Env (thisRef.ctor.defTree. asInstanceOf [ DefDef ], thisRef.args )
744
+ given Trace = Trace .empty
745
+ given Env = Env (paramValues )
743
746
744
747
val res = init(tpl, thisRef, thisRef.klass)
745
748
res.errors.foreach(_.issue)
@@ -750,7 +753,7 @@ object Semantic {
750
753
// ----- API --------------------------------
751
754
752
755
/** Add a checking task to the work list */
753
- def addTask (task : ThisRef )(using WorkList , Trace ) = workList.addTask(Task ( task)(trace) )
756
+ def addTask (task : ThisRef )(using WorkList ) = workList.addTask(task)
754
757
755
758
/** Perform check on the work list until it becomes empty
756
759
*
0 commit comments