File tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/transform/init
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -802,8 +802,11 @@ object Semantic:
802
802
else
803
803
// no source code available
804
804
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)
807
810
Hot
808
811
else
809
812
// method call resolves to a field
@@ -1646,8 +1649,7 @@ object Semantic:
1646
1649
if thisV.isThisRef || ! thisV.asInstanceOf [Warm ].isPopulatingParams then tpl.body.foreach {
1647
1650
case vdef : ValDef if ! vdef.symbol.is(Flags .Lazy ) && ! vdef.rhs.isEmpty =>
1648
1651
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)
1651
1653
fieldsChanged = true
1652
1654
1653
1655
case _ : MemberDef =>
You can’t perform that action at this time.
0 commit comments