File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -802,8 +802,11 @@ object Semantic:
802802 else
803803 // no source code available
804804 promoteArgs()
805- val error = CallUnknown (target, trace.toVector)
806- reporter.report(error)
805+ // try promoting the receiver as last resort
806+ val hasErrors = Reporter .hasErrors { ref.promote(" try promote value to hot" ) }
807+ if hasErrors then
808+ val error = CallUnknown (target, trace.toVector)
809+ reporter.report(error)
807810 Hot
808811 else
809812 // method call resolves to a field
@@ -1646,8 +1649,7 @@ object Semantic:
16461649 if thisV.isThisRef || ! thisV.asInstanceOf [Warm ].isPopulatingParams then tpl.body.foreach {
16471650 case vdef : ValDef if ! vdef.symbol.is(Flags .Lazy ) && ! vdef.rhs.isEmpty =>
16481651 val res = eval(vdef.rhs, thisV, klass)
1649- val hasErrors = Reporter .hasErrors { res.promote(" try promote value to hot" ) }
1650- thisV.updateField(vdef.symbol, if hasErrors then res else Hot )
1652+ thisV.updateField(vdef.symbol, res)
16511653 fieldsChanged = true
16521654
16531655 case _ : MemberDef =>
You can’t perform that action at this time.
0 commit comments