0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.1950: Vim9: crash when compiling function fails when getting type

Problem:    Vim9: crash when compiling function fails when getting type.
Solution:   Handle NULL type. (closes #7253)
This commit is contained in:
Bram Moolenaar
2020-11-04 12:00:53 +01:00
parent 348be7ed07
commit 9c13f76275
3 changed files with 23 additions and 2 deletions

View File

@@ -1749,6 +1749,15 @@ def Test_expr7_list_vim9script()
var l: list<string> = [234, 'x']
END
CheckScriptFailure(lines, 'E1012:', 2)
lines =<< trim END
vim9script
def Failing()
job_stop()
enddef
var list = [Failing]
END
CheckScriptFailure(lines, 'E119:', 1)
enddef
def LambdaWithComments(): func
@@ -2009,6 +2018,15 @@ def Test_expr7_dict_vim9script()
var l: dict<string> = #{a: 234, b: 'x'}
END
CheckScriptFailure(lines, 'E1012:', 2)
lines =<< trim END
vim9script
def Failing()
job_stop()
enddef
var dict = #{name: Failing}
END
CheckScriptFailure(lines, 'E119:', 1)
enddef
let g:oneString = 'one'