Problem: When assigning to @. in a :let command an incorrect "E15"
error is emitted.
Solution: Emit the correct "E354" error. (Doug Kearns).
An incorrect "E488" error was also emitted in Vim9 script assignments.
It appears that the code deleted in this commit was added to work around
a limitation in the returned value from find_name_end() that no longer
exists.
See commit
76b92b2830841fd4e05006cc3cad1d8f0bc8101b (tag: v7.0b).
closes: #18757
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
argend = skip_var_list(arg, TRUE, &var_count, &semicolon, FALSE);
if (argend == NULL)
return;
- if (argend > arg && argend[-1] == '.') // for var.='str'
- --argend;
expr = skipwhite(argend);
concat = expr[0] == '.'
&& ((expr[1] == '=' && in_old_script(2))
bwipe!
endfunc
+func Test_writing_readonly_regs()
+ call assert_fails('let @. = "foo"', 'E354:')
+ call assert_fails('let @% = "foo"', 'E354:')
+ call assert_fails('let @: = "foo"', 'E354:')
+ call assert_fails('let @~ = "foo"', 'E354:')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
END
v9.CheckDefAndScriptSuccess(lines)
- v9.CheckDefAndScriptFailure(["@. = 'yes'"], ['E354:', 'E488:'], 1)
+ v9.CheckDefAndScriptFailure(["@. = 'yes'"], 'E354:', 1)
enddef
" This is slow when run under valgrind.
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1923,
/**/
1922,
/**/