Patch 8.2.2310

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 7, 2021, 2:24:11 PM1/7/21
to vim...@googlegroups.com

Patch 8.2.2310
Problem: Vim9: winsaveview() return type is too generic.
Solution: use dict<number> instead of dict<any>. (closes #7626)
Files: src/evalfunc.c, src/testdir/test_vim9_builtin.vim


*** ../vim-8.2.2309/src/evalfunc.c 2021-01-06 21:59:35.174021934 +0100
--- src/evalfunc.c 2021-01-07 20:18:14.947225899 +0100
***************
*** 1753,1759 ****
{"winrestview", 1, 1, FEARG_1, NULL,
ret_void, f_winrestview},
{"winsaveview", 0, 0, 0, NULL,
! ret_dict_any, f_winsaveview},
{"winwidth", 1, 1, FEARG_1, NULL,
ret_number, f_winwidth},
{"wordcount", 0, 0, 0, NULL,
--- 1753,1759 ----
{"winrestview", 1, 1, FEARG_1, NULL,
ret_void, f_winrestview},
{"winsaveview", 0, 0, 0, NULL,
! ret_dict_number, f_winsaveview},
{"winwidth", 1, 1, FEARG_1, NULL,
ret_number, f_winwidth},
{"wordcount", 0, 0, 0, NULL,
*** ../vim-8.2.2309/src/testdir/test_vim9_builtin.vim 2021-01-03 15:55:05.764625605 +0100
--- src/testdir/test_vim9_builtin.vim 2021-01-07 20:20:58.694855885 +0100
***************
*** 786,791 ****
--- 786,801 ----
close
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-8.2.2309/src/version.c 2021-01-07 19:36:26.124739771 +0100
--- src/version.c 2021-01-07 20:21:57.186723523 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2310,
/**/

--
A meeting is an event at which the minutes are kept and the hours are lost.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages