patch 8.2.0753: Vim9: expressions are evaluated in the discovery phase
Problem: Vim9: expressions are evaluated in the discovery phase.
Solution: Bail out if an expression is not a constant. Require a type for
declared constants.
diff --git a/src/list.c b/src/list.c
index 6242e52..b9e7e34 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1046,8 +1046,9 @@
* Return OK or FAIL.
*/
int
-get_list_tv(char_u **arg, typval_T *rettv, int evaluate, int do_error)
+get_list_tv(char_u **arg, typval_T *rettv, int flags, int do_error)
{
+ int evaluate = flags & EVAL_EVALUATE;
list_T *l = NULL;
typval_T tv;
listitem_T *item;
@@ -1062,7 +1063,7 @@
*arg = skipwhite(*arg + 1);
while (**arg != ']' && **arg != NUL)
{
- if (eval1(arg, &tv, evaluate) == FAIL) // recursive!
+ if (eval1(arg, &tv, flags) == FAIL) // recursive!
goto failret;
if (evaluate)
{