Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 21469:4d156aead799 v8.2.1285
patch 8.2.1285: Vim9: argument types are not checked on assignment
Commit: https://github.com/vim/vim/commit/b8070e31736decfcdf8dd47997882cb8f5a64c9d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 23 20:56:04 2020 +0200
patch 8.2.1285: Vim9: argument types are not checked on assignment
Problem: Vim9: argument types are not checked on assignment.
Solution: Check function argument types. (issue https://github.com/vim/vim/issues/6507)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Jul 2020 21:00:04 +0200 |
parents | 49072a858baf |
children | eec2d2120cde |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -293,6 +293,15 @@ def Test_call_funcref() Funcref(123) END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def UseNumber(nr: number) + echo nr + enddef + let Funcref: func(string) = function('UseNumber') + END + CheckScriptFailure(lines, 'E1013: type mismatch, expected func(string) but got func(number)') enddef let SomeFunc = function('len')