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)
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index 24f62d8..0acf6c3 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -408,6 +408,15 @@
# 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 @@
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>