File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,16 @@ class Checker extends MiniPhase {
49
49
import semantic ._
50
50
val tpl = tree.rhs.asInstanceOf [Template ]
51
51
val thisRef = ThisRef (cls)
52
+
52
53
val obj = Objekt (cls, fields = mutable.Map .empty, outers = mutable.Map (cls -> Hot ))
54
+ heap.update(thisRef, obj)
55
+
56
+ val paramValues = tpl.constr.termParamss.flatten.map(param => param.symbol -> Hot ).toMap
57
+
53
58
given Promoted = Promoted .empty
54
59
given Trace = Trace .empty
55
- given Env = Env .empty
56
- heap.update(thisRef, obj)
60
+ given Env = Env (paramValues)
61
+
57
62
val res = eval(tpl, thisRef, cls)
58
63
res.errors.foreach(_.issue)
59
64
}
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ class Semantic {
73
73
74
74
def withSource (source : Tree ): Value =
75
75
if mySource.isEmpty then attachSource(source)
76
+ else if this == Hot || this == Cold then this
76
77
else {
77
78
val value2 = this .clone.asInstanceOf [Value ]
78
79
value2.mySource = source
You can’t perform that action at this time.
0 commit comments