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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220122122829.B27931C11B3%40moolenaar.net.

Raspunde prin e-mail lui