0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.2.1242: Vim9: no error if calling a function with wrong type

Problem:    Vim9: no error if calling a function with wrong argument type.
Solution:   Check types of arguments. (closes #6469)
This commit is contained in:
Bram Moolenaar
2020-07-19 14:03:09 +02:00
parent 6434fc574d
commit 65b9545f44
5 changed files with 61 additions and 0 deletions

View File

@@ -407,6 +407,17 @@ def Test_vim9script_call_fail_decl()
delete('Xcall_decl.vim')
enddef
def Test_vim9script_call_fail_type()
let lines =<< trim END
vim9script
def MyFunc(arg: string)
echo arg
enddef
MyFunc(1234)
END
CheckScriptFailure(lines, 'E1013: type mismatch, expected string but got number')
enddef
def Test_vim9script_call_fail_const()
let lines =<< trim END
vim9script