mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.0449: Vim9: crash if return type is invalid
Problem: Vim9: crash if return type is invalid. (Yegappan Lakshmanan) Solution: Always return some type, not NULL.
This commit is contained in:
@@ -269,6 +269,9 @@ def Test_return_type_wrong()
|
||||
CheckScriptFailure(['def Func(): string', 'return 1', 'enddef'], 'expected string but got number')
|
||||
CheckScriptFailure(['def Func(): void', 'return "a"', 'enddef'], 'expected void but got string')
|
||||
CheckScriptFailure(['def Func()', 'return "a"', 'enddef'], 'expected void but got string')
|
||||
|
||||
CheckScriptFailure(['def Func(): list', 'return []', 'enddef'], 'E1008:')
|
||||
CheckScriptFailure(['def Func(): dict', 'return {}', 'enddef'], 'E1008:')
|
||||
enddef
|
||||
|
||||
def Test_arg_type_wrong()
|
||||
|
Reference in New Issue
Block a user