0
0
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:
Bram Moolenaar
2020-09-23 15:56:50 +02:00
parent 04bdd573d0
commit 81ed496048
3 changed files with 40 additions and 4 deletions

View File

@@ -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