1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2020-08-28 17:19:07 +02:00
parent 6a950581da
commit ee8580e52e
4 changed files with 19 additions and 10 deletions

View File

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