CheckScriptFailure(['def Func(arg: number)', 'arg = 3', 'enddef', 'defcompile'], 'E1090:')
enddef
+" These argument names are reserved in legacy functions.
+def WithReservedNames(firstline: string, lastline: string): string
+ return firstline .. lastline
+enddef
+
+def Test_argument_names()
+ assert_equal('OK', WithReservedNames('O', 'K'))
+enddef
+
def Test_call_func_defined_later()
g:DefinedLater('one')->assert_equal('one')
assert_fails('NotDefined("one")', 'E117:', '', 2, 'Test_call_func_defined_later')
while (ASCII_ISALNUM(*p) || *p == '_')
++p;
if (arg == p || isdigit(*arg)
- || (p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0)
- || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0))
+ || (argtypes == NULL
+ && ((p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0)
+ || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0))))
{
if (!skip)
semsg(_("E125: Illegal argument: %s"), arg);