patch 8.2.4634: Vim9: cannot initialize a variable to null_list
Problem: Vim9: cannot initialize a variable to null_list.
Solution: Give negative count to NEWLIST. (closes #10027)
Also fix inconsistencies in comparing with null values.
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 8c7d0b0e..90d7c8c 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -958,7 +958,7 @@
*arg = p;
ppconst->pp_is_const = is_all_const;
- return generate_NEWLIST(cctx, count);
+ return generate_NEWLIST(cctx, count, FALSE);
}
/*
@@ -1246,7 +1246,7 @@
dict_unref(d);
ppconst->pp_is_const = is_all_const;
- return generate_NEWDICT(cctx, count);
+ return generate_NEWDICT(cctx, count, FALSE);
failret:
if (*arg == NULL)