patch 8.2.1465: Vim9: subscript not handled properly
Problem: Vim9: subscript not handled properly.
Solution: Adjust error message. Remove dead code. Disallow string to
number conversion in scripts.
diff --git a/src/list.c b/src/list.c
index 955272c..b09e87f 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1909,7 +1909,10 @@
int error = FALSE;
// filter(): when expr is zero remove the item
- *remp = (tv_get_number_chk(&rettv, &error) == 0);
+ if (in_vim9script())
+ *remp = !tv2bool(&rettv);
+ else
+ *remp = (tv_get_number_chk(&rettv, &error) == 0);
clear_tv(&rettv);
// On type error, nothing has been removed; return FAIL to stop the
// loop. The error message was given by tv_get_number_chk().