@@ -738,8 +738,7 @@ object Semantic:
738
738
else
739
739
reporter.reportAll(tryReporter.errors)
740
740
extendTrace(ddef) {
741
- val rhs = ddef.getRhs
742
- eval(rhs, ref, cls, cacheResult = true )
741
+ eval(ddef.getRhs, ref, cls, cacheResult = true )
743
742
}
744
743
else if ref.canIgnoreMethodCall(target) then
745
744
Hot
@@ -801,13 +800,10 @@ object Semantic:
801
800
val tpl = cls.defTree.asInstanceOf [TypeDef ].rhs.asInstanceOf [Template ]
802
801
extendTrace(cls.defTree) { init(tpl, ref, cls) }
803
802
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) }
811
807
end if
812
808
else
813
809
Hot
@@ -823,10 +819,7 @@ object Semantic:
823
819
extendTrace(cls.defTree) { eval(tpl, ref, cls, cacheResult = true ) }
824
820
ref
825
821
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 ) }
830
823
else if ref.canIgnoreMethodCall(ctor) then
831
824
Hot
832
825
else
@@ -936,9 +929,7 @@ object Semantic:
936
929
937
930
case Cold => Cold
938
931
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 ))
942
933
case _ =>
943
934
report.warning(" [Internal error] unexpected this value when accessing local variable, sym = " + sym.show + " , thisValue = " + thisValue2.show + Trace .show, Trace .position)
944
935
Hot
@@ -1352,12 +1343,10 @@ object Semantic:
1352
1343
}
1353
1344
1354
1345
case closureDef(ddef) =>
1355
- val rhs = ddef.getRhs
1356
- Fun (rhs, thisV, klass)
1346
+ Fun (ddef.getRhs, thisV, klass)
1357
1347
1358
1348
case PolyFun (ddef) =>
1359
- val rhs = ddef.getRhs
1360
- Fun (rhs, thisV, klass)
1349
+ Fun (ddef.getRhs, thisV, klass)
1361
1350
1362
1351
case Block (stats, expr) =>
1363
1352
eval(stats, thisV, klass)
@@ -1409,8 +1398,7 @@ object Semantic:
1409
1398
1410
1399
case vdef : ValDef =>
1411
1400
// local val definition
1412
- val rhs = vdef.getRhs
1413
- eval(rhs, thisV, klass)
1401
+ eval(vdef.getRhs, thisV, klass)
1414
1402
1415
1403
case ddef : DefDef =>
1416
1404
// local method
0 commit comments