Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 33886:cd7acb9bc4fd v9.0.2152
patch 9.0.2152: Using type unknown for List/Dict containers
Commit: https://github.com/vim/vim/commit/668971958c126d5e105fd44b60a4efcaf2c4b55c
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Dec 5 15:51:50 2023 +0100
patch 9.0.2152: Using type unknown for List/Dict containers
Problem: Using type unknown for List/Dict containers
Solution: Use 'any' instead
fixes: #13582
closes: #13625
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:23 +0100 |
parents | dbec60b8c253 |
children | 3a3f13bac124 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -387,7 +387,7 @@ def Test_expr2_fails() v9.CheckDefAndScriptFailure(["if 3"], 'E1023:', 1) v9.CheckDefExecAndScriptFailure(['var x = 3', 'if x', 'endif'], 'E1023:', 2) - v9.CheckDefAndScriptFailure(["var x = [] || false"], ['E1012: Type mismatch; expected bool but got list<unknown>', 'E745:'], 1) + v9.CheckDefAndScriptFailure(["var x = [] || false"], ['E1012: Type mismatch; expected bool but got list<any>', 'E745:'], 1) var lines =<< trim END vim9script @@ -2795,7 +2795,7 @@ def Test_expr9_dict() var ds = {k: null_string} assert_equal('dict<string>', typename(ds)) var dl = {a: null_list} - assert_equal('dict<list<unknown>>', typename(dl)) + assert_equal('dict<list<any>>', typename(dl)) END v9.CheckDefAndScriptSuccess(lines) @@ -3038,7 +3038,7 @@ def Test_expr_member() v9.CheckDefAndScriptFailure(["var x = g:dict_one.#$!"], ['E1002:', 'E15:'], 1) v9.CheckDefExecAndScriptFailure(["var d: dict<any>", "echo d['a']"], 'E716:', 2) - v9.CheckDefExecAndScriptFailure(["var d: dict<number>", "d = g:list_empty"], 'E1012: Type mismatch; expected dict<number> but got list<unknown>', 2) + v9.CheckDefExecAndScriptFailure(["var d: dict<number>", "d = g:list_empty"], 'E1012: Type mismatch; expected dict<number> but got list<any>', 2) enddef def Test_expr9_any_index_slice()