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