Problem
In Tremor Script, indexing into something which is not an array results in an error message. Consider e.g. the one in tests/script_runtime_errors/non_arr_access2/error.txt, which reads as follows:
Steps
To reproduce, index into something that's not an array, e.g. as done in tests/script_runtime_errors/non_arr_access/, tests/script_runtime_errors/non_arr_access2/, tests/script_runtime_errors/subslice_no_arr/, and perhaps others.
Possible Solution(s)
A solution may involve modifying the inner expression passed to error_need_arr in tremor-script::interpreter::resolve.
Problem In Tremor Script, indexing into something which is not an array results in an error message. Consider e.g. the one in
tests/script_runtime_errors/non_arr_access2/error.txt
, which reads as follows:The error message points to the index
42
, but the type error is due to the type ofevent.snot
. A more correct error message could be:Steps To reproduce, index into something that's not an array, e.g. as done in
tests/script_runtime_errors/non_arr_access/
,tests/script_runtime_errors/non_arr_access2/
,tests/script_runtime_errors/subslice_no_arr/
, and perhaps others.Possible Solution(s) A solution may involve modifying the
inner
expression passed toerror_need_arr
intremor-script::interpreter::resolve
.