forked from aniani/vim
patch 8.2.2357: Vim9: crash when parsing function return type fails
Problem: Vim9: crash when parsing function return type fails. Solution: Bail out and set return type to "unknown". (closes #7685)
This commit is contained in:
@@ -197,6 +197,17 @@ def Test_return_nothing()
|
||||
s:nothing->assert_equal(1)
|
||||
enddef
|
||||
|
||||
def Test_return_invalid()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
def Func(): invalid
|
||||
return xxx
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1010:', 2)
|
||||
enddef
|
||||
|
||||
func Increment()
|
||||
let g:counter += 1
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user