diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-03-13 21:24:56 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-03-13 21:24:56 +0100 |
commit | 93e1cae739c32baf28954b64718bab009c6ee2ac (patch) | |
tree | ee7d7023bf29ae1b50b4edc9a4665a8cb5a2feee /src/testdir | |
parent | edba70703b6eaee3365ddfd82e4ba56ee08486f8 (diff) |
patch 8.2.2600: Vim9: crash when putting an unknown type in a dictionaryv8.2.2600
Problem: Vim9: crash when putting an unknown type in a dictionary.
(Yegappan Lakshmanan)
Solution: Handle a NULL type pointer.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 8ec3db1482..75bbc0c506 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -340,6 +340,26 @@ def Test_extend_list_item_type() CheckScriptFailure(['vim9script'] + lines, 'E1012:', 1) enddef +def Test_extend_with_error_function() + var lines =<< trim END + vim9script + def F() + { + var m = 10 + } + echo m + enddef + + def Test() + var d: dict<any> = {} + d->extend({A: 10, Func: function('F', [])}) + enddef + + Test() + END + CheckScriptFailure(lines, 'E1001: Variable not found: m') +enddef + def Test_job_info_return_type() if has('job') job_start(&shell) |