Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 21969:ba2415df82d7 v8.2.1534
patch 8.2.1534: Vim9: type error for argument type is not at call position
Commit: https://github.com/vim/vim/commit/ee8580e52e767916e2a95e8ac0732fd8a5ae0651
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 28 17:19:07 2020 +0200
patch 8.2.1534: Vim9: type error for argument type is not at call position
Problem: Vim9: type error for argument type is not at call position.
Solution: Set the context and stack after checking the arguments.
(issue #6785)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Aug 2020 17:30:04 +0200 |
parents | bf68435a695a |
children | c9517003821d |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -223,6 +223,15 @@ def Test_call_wrong_args() call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:') call CheckDefFailure(['bufnr(xxx)'], 'E1001:') call CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:') + + let lines =<< trim END + vim9script + def Func(s: string) + echo s + enddef + Func([]) + END + call CheckScriptFailure(lines, 'E1012: type mismatch, expected string but got list<unknown>', 5) enddef " Default arg and varargs