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:
@@ -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
|
||||
|
Reference in New Issue
Block a user