diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.h | 2 | ||||
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 10 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 5 |
4 files changed, 18 insertions, 1 deletions
diff --git a/src/errors.h b/src/errors.h index bc6258cafb..cddd6910fe 100644 --- a/src/errors.h +++ b/src/errors.h @@ -276,4 +276,6 @@ EXTERN char e_final_requires_a_value[] INIT(= N_("E1125: Final requires a value")); EXTERN char e_cannot_use_let_in_vim9_script[] INIT(= N_("E1126: Cannot use :let in Vim9 script")); +EXTERN char e_missing_name_after_dot[] + INIT(= N_("E1127: Missing name after dot")); #endif diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 0a0bcb41ae..fa33089e84 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1538,6 +1538,16 @@ def Test_expr7_list() CheckDefExecFailure(["var l: list<number> = ['x', 234]"], 'E1012:', 1) CheckDefExecFailure(["var l: list<string> = [234, 'x']"], 'E1012:', 1) CheckDefExecFailure(["var l: list<string> = ['x', 123]"], 'E1012:', 1) + + var lines =<< trim END + vim9script + var datalist: list<string> + def Main() + datalist += ['x'. + enddef + Main() + END + CheckScriptFailure(lines, 'E1127:') enddef def Test_expr7_list_vim9script() diff --git a/src/version.c b/src/version.c index ff1a97a3d8..4280ac5628 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1789, +/**/ 1788, /**/ 1787, diff --git a/src/vim9compile.c b/src/vim9compile.c index 830e8bb9b6..32def6c796 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -2549,7 +2549,7 @@ compile_list(char_u **arg, cctx_T *cctx) break; } if (compile_expr0(&p, cctx) == FAIL) - break; + return FAIL; ++count; if (*p == ',') { @@ -3333,7 +3333,10 @@ compile_subscript( *arg = p + 1; if (may_get_next_line(*arg, arg, cctx) == FAIL) + { + emsg(_(e_missing_name_after_dot)); return FAIL; + } // dictionary member: dict.name p = *arg; if (eval_isdictc(*p)) |