0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1956: Vim9: cannot specify argument types for lambda

Problem:    Vim9: cannot specify argument types for lambda.
Solution:   Allow adding argument types.  Check arguments when calling a
            function reference.
This commit is contained in:
Bram Moolenaar
2020-11-05 18:45:46 +01:00
parent 66669fc664
commit b4d16cb11d
7 changed files with 178 additions and 78 deletions

View File

@@ -3266,7 +3266,7 @@ eval7(
* Lambda: {arg, arg -> expr}
* Dictionary: {'key': val, 'key': val}
*/
case '{': ret = get_lambda_tv(arg, rettv, evalarg);
case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
if (ret == NOTDONE)
ret = eval_dict(arg, rettv, evalarg, FALSE);
break;
@@ -3554,7 +3554,7 @@ eval_lambda(
*arg += 2;
rettv->v_type = VAR_UNKNOWN;
ret = get_lambda_tv(arg, rettv, evalarg);
ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
if (ret != OK)
return FAIL;
else if (**arg != '(')