mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 8.2.1133: Vim9: return type of add() is not specific enough
Problem: Vim9: return type of add() is not specific enough. Solution: Return the type of the first argument. (closes #6395)
This commit is contained in:
parent
9978d473e3
commit
fce82b3aa7
@ -441,7 +441,7 @@ static funcentry_T global_functions[] =
|
||||
{
|
||||
{"abs", 1, 1, FEARG_1, ret_any, FLOAT_FUNC(f_abs)},
|
||||
{"acos", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_acos)},
|
||||
{"add", 2, 2, FEARG_1, ret_any, f_add},
|
||||
{"add", 2, 2, FEARG_1, ret_first_arg, f_add},
|
||||
{"and", 2, 2, FEARG_1, ret_number, f_and},
|
||||
{"append", 2, 2, FEARG_LAST, ret_number, f_append},
|
||||
{"appendbufline", 3, 3, FEARG_LAST, ret_number, f_appendbufline},
|
||||
|
@ -602,6 +602,12 @@ def Test_repeat_return_type()
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(3, res)
|
||||
|
||||
res = 0
|
||||
for n in add([1, 2], 3)
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Test_func_type_part()
|
||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1133,
|
||||
/**/
|
||||
1132,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user