Skip to content

Commit 0f9a672

Browse files
committed
Add missing cacheResult flags.
1 parent 354b536 commit 0f9a672

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ object Semantic:
893893

894894
case Cold => Cold
895895

896-
case ref: Ref => eval(vdef.rhs, ref, enclosingClass)
896+
case ref: Ref => eval(vdef.rhs, ref, enclosingClass, cacheResult = true)
897897

898898
case _ =>
899899
report.error("[Internal error] unexpected this value when accessing local variable, sym = " + sym.show + ", thisValue = " + thisValue2.show + Trace.show, Trace.position)
@@ -989,7 +989,7 @@ object Semantic:
989989
val errors = Reporter.stopEarly {
990990
val res = {
991991
given Trace = Trace.empty
992-
eval(body, thisV, klass)
992+
eval(body, thisV, klass, cacheResult = true)
993993
}
994994
given Trace = Trace.empty.add(body)
995995
res.promote("The function return value is not hot. Found = " + res.show + ".")

0 commit comments

Comments
 (0)