mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.4662: no error for using out of range list index
Problem: No error for using out of range list index. Solution: Check list index at script level like in compiled function. (closes #10051)
This commit is contained in:
@@ -288,6 +288,12 @@ def Test_assign_concat()
|
||||
s ..= {a: 2}
|
||||
END
|
||||
v9.CheckDefAndScriptFailure(lines, ['E1105: Cannot convert dict to string', 'E734: Wrong variable type for .='], 2)
|
||||
|
||||
lines =<< trim END
|
||||
var ls: list<string> = []
|
||||
ls[-1] ..= 'foo'
|
||||
END
|
||||
v9.CheckDefExecAndScriptFailure(lines, 'E684: list index out of range: -1', 2)
|
||||
enddef
|
||||
|
||||
def Test_assign_register()
|
||||
|
Reference in New Issue
Block a user