To: vim_dev@googlegroups.com Subject: Patch 8.2.2642 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2642 Problem: Vim9: no clear error for wrong inline function. Solution: Check for something following the "{". Files: src/userfunc.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.2641/src/userfunc.c 2021-03-21 22:12:31.448826619 +0100 --- src/userfunc.c 2021-03-22 18:04:53.369280695 +0100 *************** *** 954,963 **** int lnum_save = -1; linenr_T sourcing_lnum_top = SOURCING_LNUM; 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) --- 954,968 ---- 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.cmdlinep = &cmdline; eap.skip = !evaluate; if (evalarg->eval_cctx != NULL) *** ../vim-8.2.2641/src/testdir/test_vim9_expr.vim 2021-03-21 20:53:24.930400991 +0100 --- src/testdir/test_vim9_expr.vim 2021-03-22 18:07:14.472977442 +0100 *************** *** 1963,1968 **** --- 1963,1973 ---- 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 *** ../vim-8.2.2641/src/version.c 2021-03-22 17:30:44.113578603 +0100 --- src/version.c 2021-03-22 18:08:47.336773293 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2642, /**/ -- hundred-and-one symptoms of being an internet addict: 17. You turn on your intercom when leaving the room so you can hear if new e-mail arrives. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///