diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-05-25 20:23:54 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-25 20:23:54 +0200 |
commit | dbac0da631c66869f41c3c573ad7a8cfef95964d (patch) | |
tree | 62bb448c9199a11ac5acf0754e4a132c3c3ddb6f /src/testdir | |
parent | dff55a335889c746a79974f7c52cdcdebad682c2 (diff) |
patch 9.1.0445: Coverity warning after 9.1.0440v9.1.0445
Problem: Coverity warning after 9.1.0440
Solution: Fix Coverity warning, add a test and
reduce the calls to clear_tv()
(Yegappan Lakshmanan).
closes: #14845
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_class.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 0754af7dec..e92fcc5736 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -10724,4 +10724,24 @@ def Test_class_definition_in_a_function() v9.CheckScriptFailure(lines, 'E1429: Class can only be used in a script', 1) enddef +" Test for using [] with a class and an object +def Test_class_object_index() + var lines =<< trim END + vim9script + class A + endclass + A[10] = 1 + END + v9.CheckScriptFailure(lines, 'E689: Index not allowed after a class: A[10] = 1', 4) + + lines =<< trim END + vim9script + class A + endclass + var a = A.new() + a[10] = 1 + END + v9.CheckScriptFailure(lines, 'E689: Index not allowed after a object: a[10] = 1', 5) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |