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:
@@ -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
|
||||
|
Reference in New Issue
Block a user