diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-23 22:22:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-23 22:22:45 +0200 |
commit | 60faf8656e1a100778bf7cd4d305380fb852d540 (patch) | |
tree | 2f15a1b30b3eabd41bd1c64267f9798e7879801f /src/eval.c | |
parent | 6b36d2a16d7931bac82ef8b5654c68ac456b24bf (diff) |
patch 8.2.3370: Vim9: no check for white space before type in declarationv8.2.3370
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)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 12931aff51..6b3d78aa6e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -887,7 +887,13 @@ get_lval( 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); |