Problem: Vim9: unclear error when passing too many arguments to lambda.
Solution: Pass the expression itself instead of "[expression]".
(closes #8604)
echo ((a) => a)('aa', 'bb')
END
CheckDefAndScriptFailure(lines, 'E118:', 1)
+
+ lines =<< trim END
+ echo 'aa'->((a) => a)('bb')
+ END
+ CheckDefFailure(lines, 'E118: Too many arguments for function: ->((a) => a)(''bb'')', 1)
+ CheckScriptFailure(['vim9script'] + lines, 'E118: Too many arguments for function: <lambda>', 2)
enddef
def FilterWithCond(x: string, Cond: func(string): bool): bool
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3195,
/**/
3194,
/**/
}
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