patch 8.2.1425: Vim9: cannot use call() without :call
Problem: Vim9: cannot use call() without :call.
Solution: Do not skip over "call(". (closes #6689)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 772b52a..24078f5 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -290,6 +290,12 @@
CheckScriptFailure(lines, 'E1013:')
enddef
+def Test_call_call()
+ let l = [3, 2, 1]
+ call('reverse', [l])
+ assert_equal([1, 2, 3], l)
+enddef
+
let s:value = ''
def FuncOneDefArg(opt = 'text')
diff --git a/src/version.c b/src/version.c
index ec86fb4..1ab7a61 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1425,
+/**/
1424,
/**/
1423,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 72c26ce..53dca80 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -6484,8 +6484,15 @@
cmdmod = save_cmdmod;
// Skip ":call" to get to the function name.
+ p = ea.cmd;
if (checkforcmd(&ea.cmd, "call", 3))
- ea.cmd = skipwhite(ea.cmd);
+ {
+ if (*ea.cmd == '(')
+ // not for "call()"
+ ea.cmd = p;
+ else
+ ea.cmd = skipwhite(ea.cmd);
+ }
if (!starts_with_colon)
{