0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1300: Vim9: optional argument type not parsed properly

Problem:    Vim9: optional argument type not parsed properly.
Solution:   Skip over the "?". (issue #6507)
This commit is contained in:
Bram Moolenaar
2020-07-26 17:56:25 +02:00
parent 2547aa930b
commit 4fc224ca1c
6 changed files with 37 additions and 11 deletions

View File

@@ -123,7 +123,7 @@ one_function_arg(char_u *arg, garray_T *newargs, garray_T *argtypes, int skip)
return arg;
}
type = skipwhite(p);
p = skip_type(type);
p = skip_type(type, TRUE);
type = vim_strnsave(type, p - type);
}
else if (*skipwhite(p) != '=')
@@ -2778,7 +2778,7 @@ def_function(exarg_T *eap, char_u *name_arg)
if (*p == ':')
{
ret_type = skipwhite(p + 1);
p = skip_type(ret_type);
p = skip_type(ret_type, FALSE);
if (p > ret_type)
{
ret_type = vim_strnsave(ret_type, p - ret_type);