1
0
forked from aniani/vim

patch 8.2.2445: Vim9: no proper error for lambda missing return type

Problem:    Vim9: no proper error for lambda missing return type.
Solution:   Check for this error. (closes #7758)
This commit is contained in:
Bram Moolenaar
2021-01-31 22:18:29 +01:00
parent e507ff15d5
commit 0346b799fc
4 changed files with 18 additions and 1 deletions

View File

@@ -687,6 +687,13 @@ def Test_call_lambda_args()
CheckDefAndScriptFailure(lines, 'E1012:')
enddef
def Test_lambda_return_type()
var lines =<< trim END
var Ref = (): => 123
END
CheckDefAndScriptFailure(lines, 'E1157:', 1)
enddef
def Test_lambda_uses_assigned_var()
CheckDefSuccess([
'var x: any = "aaa"'