Skip to content

Commit 20ff7ca

Browse files
committed
Add constructor to Warm
1 parent 7279f73 commit 20ff7ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ object Semantic {
9292
*
9393
* We need to restrict nesting levels of `outer` to finitize the domain.
9494
*/
95-
case class Warm(klass: ClassSymbol, outer: Value, args: List[Value])(using Heap) extends Ref {
95+
case class Warm(klass: ClassSymbol, outer: Value, ctor: Symbol, args: List[Value])(using Heap) extends Ref {
9696
val objekt = getCachedObject()
9797

9898
private def getCachedObject()(using Heap) =
@@ -492,7 +492,7 @@ object Semantic {
492492
Result(Hot, Errors.empty)
493493
else
494494
val outer = Hot
495-
val value = Warm(klass, outer, args2)
495+
val value = Warm(klass, outer, ctor, args2)
496496
val task = ThisRef(klass, outer, ctor, args2)
497497
this.addTask(task)
498498
Result(value, Errors.empty)
@@ -505,11 +505,11 @@ object Semantic {
505505
given Trace = trace1
506506
// widen the outer to finitize addresses
507507
val outer = ref match
508-
case Warm(_, _: Warm, _) => Cold
508+
case Warm(_, _: Warm, _, _) => Cold
509509
case _ => ref
510510

511511
val argsWidened = args.map(_.value).widenArgs
512-
val value = Warm(klass, outer, argsWidened)
512+
val value = Warm(klass, outer, ctor, argsWidened)
513513
val task = ThisRef(klass, outer, ctor, argsWidened)
514514
this.addTask(task)
515515
Result(value, Errors.empty)
@@ -1192,6 +1192,7 @@ object Semantic {
11921192

11931193
// initialize super classes after outers are set
11941194
tasks.foreach(task => task())
1195+
end if
11951196

11961197
var fieldsChanged = true
11971198

0 commit comments

Comments
 (0)