0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.2310: Vim9: winsaveview() return type is too generic

Problem:    Vim9: winsaveview() return type is too generic.
Solution:   use dict<number> instead of dict<any>. (closes #7626)
This commit is contained in:
Bram Moolenaar 2021-01-07 20:23:33 +01:00
parent c37b655443
commit 43b69b39ac
3 changed files with 13 additions and 1 deletions

View File

@ -1753,7 +1753,7 @@ static funcentry_T global_functions[] =
{"winrestview", 1, 1, FEARG_1, NULL, {"winrestview", 1, 1, FEARG_1, NULL,
ret_void, f_winrestview}, ret_void, f_winrestview},
{"winsaveview", 0, 0, 0, NULL, {"winsaveview", 0, 0, 0, NULL,
ret_dict_any, f_winsaveview}, ret_dict_number, f_winsaveview},
{"winwidth", 1, 1, FEARG_1, NULL, {"winwidth", 1, 1, FEARG_1, NULL,
ret_number, f_winwidth}, ret_number, f_winwidth},
{"wordcount", 0, 0, 0, NULL, {"wordcount", 0, 0, 0, NULL,

View File

@ -786,6 +786,16 @@ def Test_winrestcmd()
close close
enddef enddef
def Test_winsaveview()
var view: dict<number> = winsaveview()
var lines =<< trim END
var view: list<number> = winsaveview()
END
CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected list<number> but got dict<number>', 1)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@ -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 */
/**/
2310,
/**/ /**/
2309, 2309,
/**/ /**/