Patch 8.2.2053
Problem:    Vim9: lamba doesn't accept argument types.
Solution:   Optionally accept argument types at the script level.
Files:      src/eval.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.2052/src/eval.c  2020-11-23 08:31:14.101789113 +0100
--- src/eval.c  2020-11-25 21:26:24.239055411 +0100
***************
*** 3266,3272 ****
       * Lambda: {arg, arg -> expr}
       * Dictionary: {'key': val, 'key': val}
       */
!     case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
                if (ret == NOTDONE)
                    ret = eval_dict(arg, rettv, evalarg, FALSE);
                break;
--- 3266,3272 ----
       * Lambda: {arg, arg -> expr}
       * Dictionary: {'key': val, 'key': val}
       */
!     case '{': ret = get_lambda_tv(arg, rettv, in_vim9script(), evalarg);
                if (ret == NOTDONE)
                    ret = eval_dict(arg, rettv, evalarg, FALSE);
                break;
*** ../vim-8.2.2052/src/testdir/test_vim9_expr.vim      2020-11-19 
18:53:15.188492574 +0100
--- src/testdir/test_vim9_expr.vim      2020-11-25 21:06:36.592764161 +0100
***************
*** 1828,1833 ****
--- 1828,1836 ----
  
        assert_equal(false, LambdaUsingArg(0)())
        assert_equal(true, LambdaUsingArg(1)())
+ 
+       var res = map([1, 2, 3], {i: number, v: number -> i + v})
+       assert_equal([1, 3, 5], res)
    END
    CheckDefAndScriptSuccess(lines)
  
*** ../vim-8.2.2052/src/version.c       2020-11-25 20:09:05.517445569 +0100
--- src/version.c       2020-11-25 21:27:30.370771696 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2053,
  /**/

-- 
ARTHUR:    Will you ask your master if he wants to join my court at Camelot?!
GUARD #1:  But then of course African swallows are not migratory.
GUARD #2:  Oh, yeah...
GUARD #1:  So they couldn't bring a coconut back anyway...
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202011252030.0APKUeg42153172%40masaka.moolenaar.net.

Raspunde prin e-mail lui