mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2308: Vim9: no error when assigning lambda to funcref
Problem: Vim9: no error when assigning lambda to funcref without return value. Solution: Default return value to "any". (closes #7629)
This commit is contained in:
@@ -1091,6 +1091,13 @@ def Test_assign_lambda()
|
||||
assert_equal(123, FuncRef_Any())
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
var Ref: func(number)
|
||||
Ref = (j) => !j
|
||||
END
|
||||
CheckDefFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(any): bool')
|
||||
CheckScriptFailure(['vim9script'] + lines, 'E1012: Type mismatch; expected func(number) but got func(any): any')
|
||||
enddef
|
||||
|
||||
def Test_heredoc()
|
||||
|
Reference in New Issue
Block a user