0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.1134: Vim9: getting a list member may not work

Problem:    Vim9: getting a list member may not work.
Solution:   Clear the list only after copying the item. (closes #6393)
This commit is contained in:
Bram Moolenaar
2020-07-05 16:42:13 +02:00
parent fce82b3aa7
commit 435d89789e
3 changed files with 14 additions and 2 deletions

View File

@@ -1141,6 +1141,11 @@ def Test_expr_member()
call CheckDefExecFailure(["let d: dict<number>", "d = g:list_empty"], 'E1029: Expected dict but got list')
enddef
def Test_expr_index()
# getting the one member should clear the list only after getting the item
assert_equal('bbb', ['aaa', 'bbb', 'ccc'][1])
enddef
def Test_expr_member_vim9script()
let lines =<< trim END
vim9script