comparison src/testdir/test_vim9_builtin.vim @ 24808:0bc60e26a2b5 v8.2.2942

patch 8.2.2942: Vim9: error when calling function with too few arguments Commit: https://github.com/vim/vim/commit/8da6d6db340069b3307e6bce3cdd40441197efce Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 5 18:15:09 2021 +0200 patch 8.2.2942: Vim9: error when calling function with too few arguments Problem: Vim9: internal error when calling function with too few arguments Solution: Check for argument count to be too few. (closes https://github.com/vim/vim/issues/8325)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Jun 2021 18:30:03 +0200
parents b19c8150ee9d
children 8fdf839af1f4
comparison
equal deleted inserted replaced
24807:e651d1ef23b5 24808:0bc60e26a2b5
808 var l = ['a', 'b', 'c'] 808 var l = ['a', 'b', 'c']
809 map(l, MapOne) 809 map(l, MapOne)
810 assert_equal(['0:a', '1:b', '2:c'], l) 810 assert_equal(['0:a', '1:b', '2:c'], l)
811 END 811 END
812 CheckDefAndScriptSuccess(lines) 812 CheckDefAndScriptSuccess(lines)
813
814 lines =<< trim END
815 range(3)->map((a, b, c) => a + b + c)
816 END
817 CheckDefExecAndScriptFailure(lines, 'E1190: One argument too few')
818 lines =<< trim END
819 range(3)->map((a, b, c, d) => a + b + c + d)
820 END
821 CheckDefExecAndScriptFailure(lines, 'E1190: 2 arguments too few')
813 enddef 822 enddef
814 823
815 def Test_map_item_type() 824 def Test_map_item_type()
816 var lines =<< trim END 825 var lines =<< trim END
817 var l = ['a', 'b', 'c'] 826 var l = ['a', 'b', 'c']