mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.2.1731: Vim9: cannot use += to append to empty NULL list
Problem: Vim9: cannot use += to append to empty NULL list. Solution: Copy the list instead of extending it. (closes #6998)
This commit is contained in:
@@ -223,6 +223,20 @@ def Test_assignment()
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_extend_list()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
let l: list<number>
|
||||
l += [123]
|
||||
assert_equal([123], l)
|
||||
|
||||
let d: dict<number>
|
||||
d['one'] = 1
|
||||
assert_equal(#{one: 1}, d)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_single_letter_vars()
|
||||
# single letter variables
|
||||
let a: number = 123
|
||||
|
Reference in New Issue
Block a user