changeset 26741:59dde78e9436 v8.2.3899

patch 8.2.3899: Vim9: test for map() on string fails Commit: https://github.com/vim/vim/commit/ec86520f946a40d5c4a92d6a11d6928faa13abd4 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 25 22:10:42 2021 +0000 patch 8.2.3899: Vim9: test for map() on string fails Problem: Vim9: test for map() on string fails. Solution: Expect string return type.
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Dec 2021 23:15:04 +0100
parents 9ed6ad5a8a73
children 00732e690ee8
files src/evalfunc.c src/version.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -517,8 +517,9 @@ arg_map_func(type_T *type, argcontext_T 
 	if (context->arg_types[0]->tt_type == VAR_LIST
 		|| context->arg_types[0]->tt_type == VAR_DICT)
 	    expected = context->arg_types[0]->tt_member;
-	else if (context->arg_types[0]->tt_type == VAR_STRING
-		|| context->arg_types[0]->tt_type == VAR_BLOB)
+	else if (context->arg_types[0]->tt_type == VAR_STRING)
+	    expected = &t_string;
+	else if (context->arg_types[0]->tt_type == VAR_BLOB)
 	    expected = &t_number;
 	if (expected != NULL)
 	{
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3899,
+/**/
     3898,
 /**/
     3897,