patch 8.2.1306: checking for first character of dict key is inconsistent
Problem: Checking for first character of dict key is inconsistent.
Solution: Add eval_isdictc(). (closes #6546)
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index d7072f3..5b46c32 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1310,6 +1310,11 @@
])
assert_equal(1, d
.one)
+ d = {'1': 1, '_': 2}
+ assert_equal(1, d
+ .1)
+ assert_equal(2, d
+ ._)
# getting the one member should clear the dict after getting the item
assert_equal('one', #{one: 'one'}.one)
@@ -1330,10 +1335,16 @@
vim9script
let d = #{one:
'one',
- two: 'two'}
+ two: 'two',
+ 1: 1,
+ _: 2}
assert_equal('one', d.one)
assert_equal('one', d
.one)
+ assert_equal(1, d
+ .1)
+ assert_equal(2, d
+ ._)
assert_equal('one', d[
'one'
])