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

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 #6507)
This commit is contained in:
Bram Moolenaar
2020-07-23 20:56:04 +02:00
parent bfba8651a5
commit b8070e3173
3 changed files with 34 additions and 0 deletions

View File

@@ -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')