diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-09 17:24:52 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-09 17:24:52 +0200 |
commit | 767034c5b82ba8999d9fed2f997436e6e3e99419 (patch) | |
tree | b41c9572fc063a1bd77a6b2347d9148ef9955760 /src/testdir/test_vim9_func.vim | |
parent | dcae51facc4d6de1edd62f0242b40972be841103 (diff) |
patch 8.2.2739: Vim9: a lambda accepts too many arguments at the script levelv8.2.2739
Problem: Vim9: a lambda accepts too many arguments at the script level.
Solution: Do not set uf_varargs in Vim9 script.
Diffstat (limited to 'src/testdir/test_vim9_func.vim')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 730cf40aaa..b0669fe651 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -836,6 +836,11 @@ def Test_call_lambda_args() enddef END CheckDefFailure(lines, 'E1167:') + + lines =<< trim END + echo ((a) => a)('aa', 'bb') + END + CheckDefAndScriptFailure(lines, 'E118:', 1) enddef def FilterWithCond(x: string, Cond: func(string): bool): bool @@ -2114,7 +2119,7 @@ def Test_list_lambda() ->substitute("('", ' ', '') ->substitute("')", '', '') ->substitute('function\zs', ' ', '')) - assert_match('def <lambda>\d\+(_: any, ...): number\n1 return 0\n enddef', body) + assert_match('def <lambda>\d\+(_: any): number\n1 return 0\n enddef', body) enddef def DoFilterThis(a: string): list<string> @@ -2363,7 +2368,7 @@ def Test_did_emsg_reset() vim9script au BufWinLeave * # def Func() - popup_menu('', {callback: () => popup_create('', {})->popup_close()}) + popup_menu('', {callback: (a, b) => popup_create('', {})->popup_close()}) eval [][0] enddef nno <F3> <cmd>call <sid>Func()<cr> |