diff src/userfunc.c @ 25038:efdb9608cc11 v8.2.3056

patch 8.2.3056: Vim9: using default value in lambda gives confusing error Commit: https://github.com/vim/vim/commit/14ded11fcad77ebf41032ec80a95d516ca9acb1c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 26 19:25:49 2021 +0200 patch 8.2.3056: Vim9: using default value in lambda gives confusing error Problem: Vim9: using default value in lambda gives confusing error. Solution: Pass "default_args" on the first pass to get the arguments. (closes #8455)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Jun 2021 19:30:03 +0200
parents 494112d2aa93
children 3f39b6b73019
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1222,7 +1222,7 @@ get_lambda_tv(
     s = *arg + 1;
     ret = get_function_args(&s, equal_arrow ? ')' : '-', NULL,
 	    types_optional ? &argtypes : NULL, types_optional, evalarg,
-						 NULL, NULL, TRUE, NULL, NULL);
+					NULL, &default_args, TRUE, NULL, NULL);
     if (ret == FAIL || skip_arrow(s, equal_arrow, &ret_type, NULL) == NULL)
     {
 	if (types_optional)