diff src/cmdexpand.c @ 30043:fd855ad74887 v9.0.0359

patch 9.0.0359: error message for wrong argument type is not specific Commit: https://github.com/vim/vim/commit/8deb2b30c77035bb682ccf80b781455ac1d6038b Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Fri Sep 2 15:15:27 2022 +0100 patch 9.0.0359: error message for wrong argument type is not specific Problem: Error message for wrong argument type is not specific. Solution: Include more information in the error. (Yegappan Lakshmanan, closes #11037)
author Bram Moolenaar <Bram@vim.org>
date Fri, 02 Sep 2022 16:30:07 +0200
parents 578e71f924fe
children 58fb880f3607
line wrap: on
line diff
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -3679,11 +3679,8 @@ f_getcompletion(typval_T *argvars, typva
 	return;
 
     pat = tv_get_string(&argvars[0]);
-    if (argvars[1].v_type != VAR_STRING)
-    {
-	semsg(_(e_invalid_argument_str), "type must be a string");
+    if (check_for_string_arg(argvars, 1) == FAIL)
 	return;
-    }
     type = tv_get_string(&argvars[1]);
 
     if (argvars[2].v_type != VAR_UNKNOWN)