0
0
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:
Bram Moolenaar
2021-04-05 20:51:00 +02:00
parent 2927c07b0e
commit b9c0cd897a
4 changed files with 61 additions and 31 deletions

View File

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