@@ -336,11 +336,12 @@ object Objects:
336
336
def emptyEnv (meth : Symbol )(using Context ): Data =
337
337
new LocalEnv (Map .empty, meth, NoEnv )(valsMap = mutable.Map .empty, varsMap = mutable.Map .empty)
338
338
339
- def valValue (x : Symbol )(using data : Data , ctx : Context ): Value =
339
+ def valValue (x : Symbol )(using data : Data , ctx : Context , trace : Trace ): Value =
340
340
data.getVal(x) match
341
341
case Some (theValue) =>
342
342
theValue
343
343
case _ =>
344
+ report.warning(" [Internal error] Value not found " + x.show + " \n env = " + data.show + " . Calling trace:\n " + Trace .show, Trace .position)
344
345
Bottom
345
346
346
347
def getVal (x : Symbol )(using data : Data , ctx : Context ): Option [Value ] = data.getVal(x)
@@ -867,32 +868,28 @@ object Objects:
867
868
Bottom
868
869
end if
869
870
case _ =>
871
+ report.warning(" [Internal error] Variable not found " + sym.show + " \n env = " + env.show + " . Calling trace:\n " + Trace .show, Trace .position)
870
872
Bottom
871
873
else if sym.isPatternBound then
872
874
// TODO: handle patterns
873
875
Cold
874
876
else
875
877
given Env .Data = env
876
- try
877
- // Assume forward reference check is doing a good job
878
- val value = Env .valValue(sym)
879
- if isByNameParam(sym) then
880
- value match
881
- case fun : Fun =>
882
- given Env .Data = fun.env
883
- eval(fun.code, fun.thisV, fun.klass)
884
- case Cold =>
885
- report.warning(" Calling cold by-name alias. Call trace: \n " + Trace .show, Trace .position)
886
- Bottom
887
- case _ : RefSet | _ : Ref =>
888
- report.warning(" [Internal error] Unexpected by-name value " + value.show + " . Calling trace:\n " + Trace .show, Trace .position)
889
- Bottom
890
- else
891
- value
892
-
893
- catch ex =>
894
- report.warning(" [Internal error] Not found " + sym.show + " \n env = " + env.show + " . Calling trace:\n " + Trace .show, Trace .position)
895
- Bottom
878
+ // Assume forward reference check is doing a good job
879
+ val value = Env .valValue(sym)
880
+ if isByNameParam(sym) then
881
+ value match
882
+ case fun : Fun =>
883
+ given Env .Data = fun.env
884
+ eval(fun.code, fun.thisV, fun.klass)
885
+ case Cold =>
886
+ report.warning(" Calling cold by-name alias. Call trace: \n " + Trace .show, Trace .position)
887
+ Bottom
888
+ case _ : RefSet | _ : Ref =>
889
+ report.warning(" [Internal error] Unexpected by-name value " + value.show + " . Calling trace:\n " + Trace .show, Trace .position)
890
+ Bottom
891
+ else
892
+ value
896
893
897
894
case _ =>
898
895
if isByNameParam(sym) then
@@ -921,6 +918,7 @@ object Objects:
921
918
else
922
919
Heap .write(addr, value)
923
920
case _ =>
921
+ report.warning(" [Internal error] Variable not found " + sym.show + " \n env = " + env.show + " . Calling trace:\n " + Trace .show, Trace .position)
924
922
925
923
case _ =>
926
924
report.warning(" Assigning to variables in outer scope. Calling trace:\n " + Trace .show, Trace .position)
0 commit comments