mirror of
https://github.com/vim/vim.git
synced 2025-11-09 10:37:17 -05:00
patch 8.2.3128: Vim9: uninitialzed list does not get type checked
Problem: Vim9: uninitialzed list does not get type checked. Solution: Set the type when initializing the variable. (closes #8529)
This commit is contained in:
@@ -111,6 +111,13 @@ def Test_add_list()
|
||||
l->add(123)
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
var l: list<string>
|
||||
l->add(123)
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3)
|
||||
enddef
|
||||
|
||||
def Test_add_blob()
|
||||
|
||||
Reference in New Issue
Block a user