mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.0973: Vim9: type is not checked when assigning to a script variable
Problem: Vim9: type is not checked when assigning to a script variable. Solution: Check the type.
This commit is contained in:
@@ -1831,6 +1831,15 @@ def Test_let_declaration()
|
||||
unlet g:var_test
|
||||
enddef
|
||||
|
||||
def Test_let_type_check()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
let var: string
|
||||
var = 1234
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1013:')
|
||||
enddef
|
||||
|
||||
def Test_forward_declaration()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user