Problem: Vim9: no check for white space before type in declaration.
(Naohiro Ono)
Solution: Check for white space like in a compiled function. (closes #8785)
if (*p == ':')
{
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
- char_u *tp = skipwhite(p + 1);
+ char_u *tp = skipwhite(p + 1);
+
+ if (tp == p + 1 && !quiet)
+ {
+ semsg(_(e_white_space_required_after_str_str), ":", p);
+ return NULL;
+ }
// parse the type after the name
lp->ll_type = parse_type(&tp, &si->sn_type_list, !quiet);
END
CheckScriptFailure(lines, 'E1069:')
+ CheckDefAndScriptFailure(['var n:number = 42'], 'E1069:')
+
lines =<< trim END
vim9script
var name: asdf
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3370,
/**/
3369,
/**/