Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 24118:1027495445bc v8.2.2600
patch 8.2.2600: Vim9: crash when putting an unknown type in a dictionary
Commit: https://github.com/vim/vim/commit/93e1cae739c32baf28954b64718bab009c6ee2ac
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 13 21:24:56 2021 +0100
patch 8.2.2600: Vim9: crash when putting an unknown type in a dictionary
Problem: Vim9: crash when putting an unknown type in a dictionary.
(Yegappan Lakshmanan)
Solution: Handle a NULL type pointer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Mar 2021 21:30:03 +0100 |
parents | 1765b5b0f08d |
children | 083f07f99e20 |
comparison
equal
deleted
inserted
replaced
24117:a59394b32332 | 24118:1027495445bc |
---|---|
336 var l: list<number> = [1] | 336 var l: list<number> = [1] |
337 g:ExtendList(l) | 337 g:ExtendList(l) |
338 END | 338 END |
339 CheckDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) | 339 CheckDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) |
340 CheckScriptFailure(['vim9script'] + lines, 'E1012:', 1) | 340 CheckScriptFailure(['vim9script'] + lines, 'E1012:', 1) |
341 enddef | |
342 | |
343 def Test_extend_with_error_function() | |
344 var lines =<< trim END | |
345 vim9script | |
346 def F() | |
347 { | |
348 var m = 10 | |
349 } | |
350 echo m | |
351 enddef | |
352 | |
353 def Test() | |
354 var d: dict<any> = {} | |
355 d->extend({A: 10, Func: function('F', [])}) | |
356 enddef | |
357 | |
358 Test() | |
359 END | |
360 CheckScriptFailure(lines, 'E1001: Variable not found: m') | |
341 enddef | 361 enddef |
342 | 362 |
343 def Test_job_info_return_type() | 363 def Test_job_info_return_type() |
344 if has('job') | 364 if has('job') |
345 job_start(&shell) | 365 job_start(&shell) |