forked from aniani/vim
patch 8.2.2053: Vim9: lamba doesn't accept argument types
Problem: Vim9: lamba doesn't accept argument types. Solution: Optionally accept argument types at the script level.
This commit is contained in:
parent
47a2abf0bc
commit
c2ca935d26
@ -3266,7 +3266,7 @@ eval7(
|
|||||||
* Lambda: {arg, arg -> expr}
|
* Lambda: {arg, arg -> expr}
|
||||||
* Dictionary: {'key': val, 'key': val}
|
* Dictionary: {'key': val, 'key': val}
|
||||||
*/
|
*/
|
||||||
case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
|
case '{': ret = get_lambda_tv(arg, rettv, in_vim9script(), evalarg);
|
||||||
if (ret == NOTDONE)
|
if (ret == NOTDONE)
|
||||||
ret = eval_dict(arg, rettv, evalarg, FALSE);
|
ret = eval_dict(arg, rettv, evalarg, FALSE);
|
||||||
break;
|
break;
|
||||||
|
@ -1828,6 +1828,9 @@ def Test_expr7_lambda()
|
|||||||
|
|
||||||
assert_equal(false, LambdaUsingArg(0)())
|
assert_equal(false, LambdaUsingArg(0)())
|
||||||
assert_equal(true, LambdaUsingArg(1)())
|
assert_equal(true, LambdaUsingArg(1)())
|
||||||
|
|
||||||
|
var res = map([1, 2, 3], {i: number, v: number -> i + v})
|
||||||
|
assert_equal([1, 3, 5], res)
|
||||||
END
|
END
|
||||||
CheckDefAndScriptSuccess(lines)
|
CheckDefAndScriptSuccess(lines)
|
||||||
|
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2053,
|
||||||
/**/
|
/**/
|
||||||
2052,
|
2052,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user