summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-14 18:56:45 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-14 18:56:45 +0200
commit32f335f75c5860baa452144f63ab7a4a3dd83134 (patch)
treeddd061cea41326c1ce64f7b6ad959abec6baa662
parent7517ffdbb564250de72ee3ef64fecf4a486df519 (diff)
downloadvim-git-32f335f75c5860baa452144f63ab7a4a3dd83134.tar.gz
patch 8.2.1447: Vim9: return type of keys() is list<any>v8.2.1447
Problem: Vim9: return type of keys() is list<any>. Solution: Should be list<string>. (closes #6711)
-rw-r--r--src/evalfunc.c2
-rw-r--r--src/testdir/test_vim9_func.vim5
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index d95a1db82..ff814622a 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -715,7 +715,7 @@ static funcentry_T global_functions[] =
{"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},
+ {"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},
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 3e7212094..75db260ce 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1283,6 +1283,11 @@ def Test_insert_return_type()
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
diff --git a/src/version.c b/src/version.c
index a8a1d49d5..11dd39654 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1447,
+/**/
1446,
/**/
1445,