diff src/evalfunc.c @ 27867:1b75d767d9e4 v8.2.4459

patch 8.2.4459: Vim9: compiling sort() call fails with unknown arguments Commit: https://github.com/vim/vim/commit/fa02616718103be3f9e13e26d57905d4eddf836d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 23 21:03:32 2022 +0000 patch 8.2.4459: Vim9: compiling sort() call fails with unknown arguments Problem: Vim9: compiling sort() call fails with a funcref that has unknown arguments. Solution: Do not check the arguments if they are unknown at compile time. (closes #9835)
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Feb 2022 22:15:03 +0100
parents 05d222e5246a
children c724906134a3
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -624,6 +624,8 @@ arg_sort_how(type_T *type, type_T *decl_
 	    where_T where = WHERE_INIT;
 
 	    args[1] = args[0];
+	    if (type->tt_argcount == -1)
+		t_func_exp.tt_argcount = -1;
 	    where.wt_index = 2;
 	    return check_type(&t_func_exp, type, TRUE, where);
 	}