Patch 8.2.1447
Problem:    Vim9: return type of keys() is list<any>.
Solution:   Should be list<string>. (closes #6711)
Files:      src/evalfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1446/src/evalfunc.c      2020-08-12 21:34:43.266489468 +0200
--- src/evalfunc.c      2020-08-14 18:56:15.700909766 +0200
***************
*** 715,721 ****
      {"js_encode",     1, 1, FEARG_1,    ret_string,   f_js_encode},
      {"json_decode",   1, 1, FEARG_1,    ret_any,      f_json_decode},
      {"json_encode",   1, 1, FEARG_1,    ret_string,   f_json_encode},
!     {"keys",          1, 1, FEARG_1,    ret_list_any, f_keys},
      {"last_buffer_nr",        0, 0, 0,          ret_number,   
f_last_buffer_nr}, // obsolete
      {"len",           1, 1, FEARG_1,    ret_number,   f_len},
      {"libcall",               3, 3, FEARG_3,    ret_string,   f_libcall},
--- 715,721 ----
      {"js_encode",     1, 1, FEARG_1,    ret_string,   f_js_encode},
      {"json_decode",   1, 1, FEARG_1,    ret_any,      f_json_decode},
      {"json_encode",   1, 1, FEARG_1,    ret_string,   f_json_encode},
!     {"keys",          1, 1, FEARG_1,    ret_list_string, f_keys},
      {"last_buffer_nr",        0, 0, 0,          ret_number,   
f_last_buffer_nr}, // obsolete
      {"len",           1, 1, FEARG_1,    ret_number,   f_len},
      {"libcall",               3, 3, FEARG_3,    ret_string,   f_libcall},
*** ../vim-8.2.1446/src/testdir/test_vim9_func.vim      2020-08-14 
18:35:02.869408647 +0200
--- src/testdir/test_vim9_func.vim      2020-08-14 18:55:46.077113726 +0200
***************
*** 1283,1288 ****
--- 1283,1293 ----
    assert_equal(6, res)
  enddef
  
+ def Test_keys_return_type()
+   const var: list<string> = #{a: 1, b: 2}->keys()
+   assert_equal(['a', 'b'], var)
+ enddef
+ 
  def Test_reverse_return_type()
    let l = reverse([1, 2, 3])
    let res = 0
*** ../vim-8.2.1446/src/version.c       2020-08-14 18:35:02.869408647 +0200
--- src/version.c       2020-08-14 18:53:23.670092546 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1447,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
196. Your computer costs more than your car.

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202008141659.07EGxgDD098446%40masaka.moolenaar.net.

Raspunde prin e-mail lui