mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.2722: Vim9: crash when using LHS with double index
Problem: Vim9: crash when using LHS with double index. Solution: Handle lhs_dest which is "dest_expr". (closes #8068) Fix confusing error message for missing dict item.
This commit is contained in:
@@ -1146,6 +1146,12 @@ def Test_assign_dict_with_op()
|
||||
assert_equal(2, dn.a)
|
||||
dn.a %= 6
|
||||
assert_equal(2, dn.a)
|
||||
|
||||
var dd: dict<dict<list<any>>>
|
||||
dd.a = {}
|
||||
dd.a.b = [0]
|
||||
dd.a.b += [1]
|
||||
assert_equal({a: {b: [0, 1]}}, dd)
|
||||
END
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
enddef
|
||||
@@ -1187,6 +1193,13 @@ def Test_assign_with_op_fails()
|
||||
s[1] ..= 'x'
|
||||
END
|
||||
CheckDefAndScriptFailure2(lines, 'E1141:', 'E689:', 2)
|
||||
|
||||
lines =<< trim END
|
||||
var dd: dict<dict<list<any>>>
|
||||
dd.a = {}
|
||||
dd.a.b += [1]
|
||||
END
|
||||
CheckDefExecAndScriptFailure(lines, 'E716:', 3)
|
||||
enddef
|
||||
|
||||
def Test_assign_lambda()
|
||||
|
Reference in New Issue
Block a user