mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.3682: Vim9: assigning to a script variable drops the type
Problem: Vim9: assigning to a script variable drops the required type. Solution: Lookup the type of the variable and use it. (closes #9219)
This commit is contained in:
@@ -322,6 +322,16 @@ def Test_skipped_assignment()
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_assign_keep_type()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
var l: list<number> = [123]
|
||||
l = [123]
|
||||
l->add('string')
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1012:', 4)
|
||||
enddef
|
||||
|
||||
def Test_assign_unpack()
|
||||
var lines =<< trim END
|
||||
var v1: number
|
||||
|
Reference in New Issue
Block a user