mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3056: Vim9: using default value in lambda gives confusing error
Problem: Vim9: using default value in lambda gives confusing error. Solution: Pass "default_args" on the first pass to get the arguments. (closes #8455)
This commit is contained in:
parent
3a3b10e87a
commit
14ded11fca
@ -917,6 +917,12 @@ def Test_call_lambda_args()
|
|||||||
CheckDefFailure(lines, 'E1167:')
|
CheckDefFailure(lines, 'E1167:')
|
||||||
CheckScriptFailure(['vim9script'] + lines, 'E1168:')
|
CheckScriptFailure(['vim9script'] + lines, 'E1168:')
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
var Ref: func(any, ?any): bool
|
||||||
|
Ref = (_, y = 1) => false
|
||||||
|
END
|
||||||
|
CheckDefAndScriptFailure(lines, 'E1172:')
|
||||||
|
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
def ShadowLocal()
|
def ShadowLocal()
|
||||||
var one = 1
|
var one = 1
|
||||||
|
@ -1222,7 +1222,7 @@ get_lambda_tv(
|
|||||||
s = *arg + 1;
|
s = *arg + 1;
|
||||||
ret = get_function_args(&s, equal_arrow ? ')' : '-', NULL,
|
ret = get_function_args(&s, equal_arrow ? ')' : '-', NULL,
|
||||||
types_optional ? &argtypes : NULL, types_optional, evalarg,
|
types_optional ? &argtypes : NULL, types_optional, evalarg,
|
||||||
NULL, NULL, TRUE, NULL, NULL);
|
NULL, &default_args, TRUE, NULL, NULL);
|
||||||
if (ret == FAIL || skip_arrow(s, equal_arrow, &ret_type, NULL) == NULL)
|
if (ret == FAIL || skip_arrow(s, equal_arrow, &ret_type, NULL) == NULL)
|
||||||
{
|
{
|
||||||
if (types_optional)
|
if (types_optional)
|
||||||
|
@ -755,6 +755,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 */
|
||||||
|
/**/
|
||||||
|
3056,
|
||||||
/**/
|
/**/
|
||||||
3055,
|
3055,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user