forked from aniani/vim
patch 8.2.1132: Vim9: return type of repeat() is not specific enough
Problem: Vim9: return type of repeat() is not specific enough. Solution: Return the type of the first argument. (closes #6395)
This commit is contained in:
@@ -815,10 +815,10 @@ static funcentry_T global_functions[] =
|
||||
{"remote_peek", 1, 2, FEARG_1, ret_number, f_remote_peek},
|
||||
{"remote_read", 1, 2, FEARG_1, ret_string, f_remote_read},
|
||||
{"remote_send", 2, 3, FEARG_1, ret_string, f_remote_send},
|
||||
{"remote_startserver", 1, 1, FEARG_1, ret_void, f_remote_startserver},
|
||||
{"remote_startserver", 1, 1, FEARG_1, ret_void, f_remote_startserver},
|
||||
{"remove", 2, 3, FEARG_1, ret_any, f_remove},
|
||||
{"rename", 2, 2, FEARG_1, ret_number, f_rename},
|
||||
{"repeat", 2, 2, FEARG_1, ret_any, f_repeat},
|
||||
{"repeat", 2, 2, FEARG_1, ret_first_arg, f_repeat},
|
||||
{"resolve", 1, 1, FEARG_1, ret_string, f_resolve},
|
||||
{"reverse", 1, 1, FEARG_1, ret_any, f_reverse},
|
||||
{"round", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_round)},
|
||||
|
||||
@@ -596,6 +596,14 @@ def Test_func_type()
|
||||
assert_equal(13, funcResult)
|
||||
enddef
|
||||
|
||||
def Test_repeat_return_type()
|
||||
let res = 0
|
||||
for n in repeat([1], 3)
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(3, res)
|
||||
enddef
|
||||
|
||||
def Test_func_type_part()
|
||||
let RefVoid: func: void
|
||||
RefVoid = FuncNoArgNoRet
|
||||
|
||||
@@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1132,
|
||||
/**/
|
||||
1131,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user