diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-22 14:58:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-22 14:58:47 +0200 |
commit | 7a3fe3e180bdbce8f193abdf399559c5154bdaae (patch) | |
tree | 842eac4734c81db7a49ddaaf20b4fea732bb8162 /src/testdir/test_vim9_builtin.vim | |
parent | a74901929e999a0052c1ce388ab09359c10cbb0d (diff) | |
download | vim-git-7a3fe3e180bdbce8f193abdf399559c5154bdaae.tar.gz |
patch 8.2.3200: Vim9: hard to guess where a type error is givenv8.2.3200
Problem: Vim9: hard to guess where a type error is given.
Solution: Add the function name where possible. (closes #8608)
Diffstat (limited to 'src/testdir/test_vim9_builtin.vim')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index fb9c868ec..741e74a3b 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -795,6 +795,8 @@ def Test_extend_arg_types() CheckDefFailure(['extend([1], ["b"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') CheckDefExecFailure(['extend([1], ["b", 1])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<any>') + + CheckScriptFailure(['vim9script', 'extend([1], ["b", 1])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<any> in extend()') enddef func g:ExtendDict(d) @@ -1741,19 +1743,19 @@ def Test_map_item_type() var l: list<number> = [0] echo map(l, (_, v) => []) END - CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown>', 2) + CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown> in map()', 2) lines =<< trim END var l: list<number> = range(2) echo map(l, (_, v) => []) END - CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown>', 2) + CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown> in map()', 2) lines =<< trim END var d: dict<number> = {key: 0} echo map(d, (_, v) => []) END - CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown>', 2) + CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<unknown> in map()', 2) enddef def Test_maparg() |