From c4c5642513ac41b22b7772cc880c776c69e964c9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 21 Jul 2021 20:38:46 +0200 Subject: 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) --- src/vim9compile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/vim9compile.c') diff --git a/src/vim9compile.c b/src/vim9compile.c index 701487548..5a39906ef 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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 -- cgit v1.2.1