# HG changeset patch # User Bram Moolenaar # Date 1616434203 -3600 # Node ID c50c5464e6dc515193f331552002ece019941380 # Parent 1b0ca859705b574b6208d0846110f87aa33d2ba2 patch 8.2.2642: Vim9: no clear error for wrong inline function Commit: https://github.com/vim/vim/commit/e98f60a5912d30db289231aed7d3a1d74beaae20 Author: Bram Moolenaar Date: Mon Mar 22 18:22:30 2021 +0100 patch 8.2.2642: Vim9: no clear error for wrong inline function Problem: Vim9: no clear error for wrong inline function. Solution: Check for something following the "{". diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1963,6 +1963,11 @@ def Test_expr7_lambda_block() assert_equal(['no', 'yes', 'no'], dll) END CheckDefAndScriptSuccess(lines) + + lines =<< trim END + map([1, 2], (k, v) => { redrawt }) + END + CheckDefAndScriptFailure(lines, 'E488') enddef def NewLambdaWithComments(): func diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -954,10 +954,15 @@ lambda_function_body( int lnum_save = -1; linenr_T sourcing_lnum_top = SOURCING_LNUM; + if (!ends_excmd2(*arg, skipwhite(*arg + 1))) + { + semsg(_(e_trailing_arg), *arg + 1); + return FAIL; + } + CLEAR_FIELD(eap); eap.cmdidx = CMD_block; eap.forceit = FALSE; - eap.arg = *arg + 1; eap.cmdlinep = &cmdline; eap.skip = !evaluate; if (evalarg->eval_cctx != NULL) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2642, +/**/ 2641, /**/ 2640,