0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.2000: Vim9: dict.key assignment not implemented yet

Problem:    Vim9: dict.key assignment not implemented yet.
Solution:   Implement dict.key assignment. (closes #7312)
This commit is contained in:
Bram Moolenaar
2020-11-16 22:11:49 +01:00
parent e6329e4c55
commit fc74d03e76
3 changed files with 35 additions and 12 deletions

View File

@@ -408,6 +408,15 @@ def Test_assignment_dict()
# overwrite
dict3['key'] = 'another'
assert_equal(dict3, #{key: 'another'})
dict3.key = 'yet another'
assert_equal(dict3, #{key: 'yet another'})
var lines =<< trim END
var dd = #{one: 1}
dd.one) = 2
END
CheckDefFailure(lines, 'E15:', 2)
# empty key can be used
var dd = {}
@@ -418,7 +427,7 @@ def Test_assignment_dict()
var somedict = rand() > 0 ? #{a: 1, b: 2} : #{a: 'a', b: 'b'}
# assignment to script-local dict
var lines =<< trim END
lines =<< trim END
vim9script
var test: dict<any> = {}
def FillDict(): dict<any>