Mercurial > vim
changeset 23879:9ddf1a537fc2
patch 8.2.2481: Vim9: confusing error when variable arguments have default
Commit: https://github.com/vim/vim/commit/4f53b79bf5f8b0de7c6933fd157894ba7a53f35e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 15:59:49 2021 +0100
patch 8.2.2481: Vim9: confusing error when variable arguments have default
Problem: Vim9: confusing error when variable arguments have a default
value.
Solution: Give a specific error message. (closes #7793)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 16:00:04 +0100 |
parents | 27d60e2c71b8 |
children | 6559c0d6eb4c |
files | src/testdir/test_vim9_func.vim src/userfunc.c src/version.c |
diffstat | 3 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -781,6 +781,16 @@ def Test_call_def_varargs() Func(1, 'a') END CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch') + + lines =<< trim END + vim9script + def Func( # some comment + ...l = [] + ) + echo l + enddef + END + CheckScriptFailure(lines, 'E1160:') enddef let s:value = ''