1
0
forked from aniani/vim

patch 8.2.2283: Vim9: crash when lambda has fewer arguments than expected

Problem:    Vim9: crash when lambda has fewer arguments than expected.
Solution:   Don't check arguments when already failed. (closes #7606)
This commit is contained in:
Bram Moolenaar
2021-01-03 13:09:51 +01:00
parent 339c1bdbdf
commit e68b02a1c4
3 changed files with 17 additions and 2 deletions

View File

@@ -554,6 +554,18 @@ def Test_call_lambda_args()
echo Ref(1, 'x')
END
CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected number but got string')
lines =<< trim END
var Ref: func(job, string, number)
Ref = (x, y) => 0
END
CheckDefAndScriptFailure(lines, 'E1012:')
lines =<< trim END
var Ref: func(job, string)
Ref = (x, y, z) => 0
END
CheckDefAndScriptFailure(lines, 'E1012:')
enddef
def Test_lambda_uses_assigned_var()