@@ -738,8 +738,7 @@ object Semantic:
738738 else
739739 reporter.reportAll(tryReporter.errors)
740740 extendTrace(ddef) {
741- val rhs = ddef.getRhs
742- eval(rhs, ref, cls, cacheResult = true )
741+ eval(ddef.getRhs, ref, cls, cacheResult = true )
743742 }
744743 else if ref.canIgnoreMethodCall(target) then
745744 Hot
@@ -801,13 +800,10 @@ object Semantic:
801800 val tpl = cls.defTree.asInstanceOf [TypeDef ].rhs.asInstanceOf [Template ]
802801 extendTrace(cls.defTree) { init(tpl, ref, cls) }
803802 else
804- val rhs = ddef.getRhs
805- if rhs.isEmpty then Hot
806- else
807- val initCall = rhs match
808- case Block (call :: _, _) => call
809- case call => call
810- extendTrace(ddef) { eval(initCall, ref, cls) }
803+ val initCall = ddef.getRhs match
804+ case Block (call :: _, _) => call
805+ case call => call
806+ extendTrace(ddef) { eval(initCall, ref, cls) }
811807 end if
812808 else
813809 Hot
@@ -823,10 +819,7 @@ object Semantic:
823819 extendTrace(cls.defTree) { eval(tpl, ref, cls, cacheResult = true ) }
824820 ref
825821 else
826- extendTrace(ddef) {
827- val rhs = ddef.getRhs
828- eval(rhs, ref, cls, cacheResult = true )
829- }
822+ extendTrace(ddef) { eval(ddef.getRhs, ref, cls, cacheResult = true ) }
830823 else if ref.canIgnoreMethodCall(ctor) then
831824 Hot
832825 else
@@ -936,9 +929,7 @@ object Semantic:
936929
937930 case Cold => Cold
938931
939- case ref : Ref =>
940- val rhs = vdef.getRhs
941- eval(rhs, ref, enclosingClass, cacheResult = sym.is(Flags .Lazy ))
932+ case ref : Ref => eval(vdef.getRhs, ref, enclosingClass, cacheResult = sym.is(Flags .Lazy ))
942933 case _ =>
943934 report.warning(" [Internal error] unexpected this value when accessing local variable, sym = " + sym.show + " , thisValue = " + thisValue2.show + Trace .show, Trace .position)
944935 Hot
@@ -1352,12 +1343,10 @@ object Semantic:
13521343 }
13531344
13541345 case closureDef(ddef) =>
1355- val rhs = ddef.getRhs
1356- Fun (rhs, thisV, klass)
1346+ Fun (ddef.getRhs, thisV, klass)
13571347
13581348 case PolyFun (ddef) =>
1359- val rhs = ddef.getRhs
1360- Fun (rhs, thisV, klass)
1349+ Fun (ddef.getRhs, thisV, klass)
13611350
13621351 case Block (stats, expr) =>
13631352 eval(stats, thisV, klass)
@@ -1409,8 +1398,7 @@ object Semantic:
14091398
14101399 case vdef : ValDef =>
14111400 // local val definition
1412- val rhs = vdef.getRhs
1413- eval(rhs, thisV, klass)
1401+ eval(vdef.getRhs, thisV, klass)
14141402
14151403 case ddef : DefDef =>
14161404 // local method
0 commit comments