mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.2481: Vim9: confusing error when variable arguments have default
Problem: Vim9: confusing error when variable arguments have a default value. Solution: Give a specific error message. (closes #7793)
This commit is contained in:
parent
c3fc75db02
commit
4f53b79bf5
@ -781,6 +781,16 @@ def Test_call_def_varargs()
|
|||||||
Func(1, 'a')
|
Func(1, 'a')
|
||||||
END
|
END
|
||||||
CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch')
|
CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch')
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
def Func( # some comment
|
||||||
|
...l = []
|
||||||
|
)
|
||||||
|
echo l
|
||||||
|
enddef
|
||||||
|
END
|
||||||
|
CheckScriptFailure(lines, 'E1160:')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
let s:value = ''
|
let s:value = ''
|
||||||
|
@ -241,6 +241,11 @@ get_function_args(
|
|||||||
skip);
|
skip);
|
||||||
if (p == arg)
|
if (p == arg)
|
||||||
break;
|
break;
|
||||||
|
if (*skipwhite(p) == '=')
|
||||||
|
{
|
||||||
|
emsg(_(e_cannot_use_default_for_variable_arguments));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
2481,
|
||||||
/**/
|
/**/
|
||||||
2480,
|
2480,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user