mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4287: cannot assign empty list with type to variable with list type
Problem: Cannot assign empty list with any list type to variable with specific list type. Solution: Use unknown list type for empty list if the specified type is any.
This commit is contained in:
@@ -1249,6 +1249,15 @@ def Test_assignment_var_list()
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_assignment_empty_list()
|
||||
var lines =<< trim END
|
||||
var l2: list<any> = []
|
||||
var l: list<string>
|
||||
l = l2
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_assignment_vim9script()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
Reference in New Issue
Block a user