diff src/vim9compile.c @ 21809:15ed135796fd v8.2.1454

patch 8.2.1454: Vim9: failure invoking lambda with wrong arguments Commit: https://github.com/vim/vim/commit/79e8db9a218ef111934594024a5cd8b1f93acada Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 14 22:16:33 2020 +0200 patch 8.2.1454: Vim9: failure invoking lambda with wrong arguments Problem: Vim9: failure invoking lambda with wrong arguments. Solution: Handle invalid arguments. Add a test.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Aug 2020 22:30:03 +0200
parents fdd58acef1cc
children 3261e28c638a
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1361,6 +1361,9 @@ generate_CALL(cctx_T *cctx, ufunc_T *ufu
 		    continue;
 		expected = ufunc->uf_arg_types[i];
 	    }
+	    else if (ufunc->uf_va_type == NULL)
+		// possibly a lambda
+		expected = &t_any;
 	    else
 		expected = ufunc->uf_va_type->tt_member;
 	    actual = ((type_T **)stack->ga_data)[stack->ga_len - argcount + i];