1
0
forked from aniani/vim

patch 8.2.3195: Vim9: unclear error when passing too many arguments to lambda

Problem:    Vim9: unclear error when passing too many arguments to lambda.
Solution:   Pass the expression itself instead of "[expression]".
            (closes #8604)
This commit is contained in:
Bram Moolenaar
2021-07-21 20:38:46 +02:00
parent cd9172077b
commit c4c5642513
3 changed files with 9 additions and 2 deletions

View File

@@ -4354,8 +4354,7 @@ compile_subscript(
}
type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
if (generate_PCALL(cctx, argcount,
(char_u *)"[expression]", type, FALSE) == FAIL)
if (generate_PCALL(cctx, argcount, p - 2, type, FALSE) == FAIL)
return FAIL;
}
else