patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Problem: Error when scriptversion is 2 a making a dictionary access.
Solution: Parse the subscript even when not evaluating the sub-expression.
(closes #4704)
diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim
index 08ab59e..82f9cac 100644
--- a/src/testdir/test_eval_stuff.vim
+++ b/src/testdir/test_eval_stuff.vim
@@ -176,6 +176,13 @@
call assert_true(v:versionlong > 8011525)
endfunc
+func Test_dict_access_scriptversion2()
+ let l:x = {'foo': 1}
+
+ call assert_false(0 && l:x.foo)
+ call assert_true(1 && l:x.foo)
+endfunc
+
func Test_scriptversion()
call writefile(['scriptversion 9'], 'Xversionscript')
call assert_fails('source Xversionscript', 'E999:')