diff src/evalfunc.c @ 28806:3754393e05bc v8.2.4927

patch 8.2.4927: return type of remove() incorrect when using three arguments Commit: https://github.com/vim/vim/commit/2ac037f54bb2588b7a86e61c9c6e9504884edbec Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 9 14:12:14 2022 +0100 patch 8.2.4927: return type of remove() incorrect when using three arguments Problem: Return type of remove() incorrect when using three arguments. Solution: Use first argument type when there are three arguments. (closes #10387)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 May 2022 15:15:03 +0200
parents 7fd3a9f05037
children 18604231a1d1
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1420,13 +1420,18 @@ ret_argv(int argcount,
     static type_T *
 ret_remove(int argcount,
 	type2_T *argtypes,
-	type_T	**decl_type UNUSED)
+	type_T	**decl_type)
 {
     if (argcount > 0)
     {
 	if (argtypes[0].type_curr->tt_type == VAR_LIST
 		|| argtypes[0].type_curr->tt_type == VAR_DICT)
 	{
+	    if (argcount == 3)
+	    {
+		*decl_type = argtypes[0].type_decl;
+		return argtypes[0].type_curr;
+	    }
 	    if (argtypes[0].type_curr->tt_type
 					     == argtypes[0].type_decl->tt_type)
 		*decl_type = argtypes[0].type_decl->tt_member;