Patch 8.2.4178

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 22, 2022, 7:28:35 AM1/22/22
to vim...@googlegroups.com

Patch 8.2.4178
Problem: Vim9: invalid error for return type of lambda when debugging.
Solution: Do not check the return type of a lambda. (closes #9589)
Files: src/vim9cmds.c


*** ../vim-8.2.4177/src/vim9cmds.c 2022-01-18 18:46:03.729827420 +0000
--- src/vim9cmds.c 2022-01-22 12:24:37.389911937 +0000
***************
*** 2196,2202 ****

if (*p != NUL && *p != '|' && *p != '\n')
{
! if (cctx->ctx_ufunc->uf_ret_type->tt_type == VAR_VOID)
{
emsg(_(e_returning_value_in_function_without_return_type));
return NULL;
--- 2196,2205 ----

if (*p != NUL && *p != '|' && *p != '\n')
{
! // For a lambda, "return expr" is always used, also when "expr" results
! // in a void.
! if (cctx->ctx_ufunc->uf_ret_type->tt_type == VAR_VOID
! && (cctx->ctx_ufunc->uf_flags & FC_LAMBDA) == 0)
{
emsg(_(e_returning_value_in_function_without_return_type));
return NULL;
*** ../vim-8.2.4177/src/version.c 2022-01-22 11:27:24.694028145 +0000
--- src/version.c 2022-01-22 12:26:51.643363875 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4178,
/**/

--
Lose weight, NEVER Diet again with
The "Invisible Weight Loss Patch"
(spam e-mail)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages