return OK;
}
+/*
+ * Make a copy of blob "tv1" and append blob "tv2".
+ */
void
eval_addblob(typval_T *tv1, typval_T *tv2)
{
}
}
+/*
+ * Make a copy of list "tv1" and append list "tv2".
+ */
int
eval_addlist(typval_T *tv1, typval_T *tv2)
{
#ifdef FEAT_FLOAT
&& (op == '.' || rettv->v_type != VAR_FLOAT)
#endif
- )
+ && evaluate)
{
+ int error = FALSE;
+
// For "list + ...", an illegal use of the first operand as
// a number cannot be determined before evaluating the 2nd
// operand: if this is also a list, all is ok.
// we know that the first operand needs to be a string or number
// without evaluating the 2nd operand. So check before to avoid
// side effects after an error.
- if (evaluate && tv_get_string_chk(rettv) == NULL)
+ if (op != '.')
+ tv_get_number_chk(rettv, &error);
+ if ((op == '.' && tv_get_string_chk(rettv) == NULL) || error)
{
clear_tv(rettv);
return FAIL;
vim9script
echo {} - 22
END
- CheckScriptFailure(lines, 'E731:', 2)
+ CheckScriptFailure(lines, 'E728:', 2)
+
+ lines =<< trim END
+ vim9script
+ echo [] - 33
+ END
+ CheckScriptFailure(lines, 'E745:', 2)
+
+ lines =<< trim END
+ vim9script
+ echo 0z1234 - 44
+ END
+ CheckScriptFailure(lines, 'E974:', 2)
lines =<< trim END
vim9script