Yegappan wrote:
> When I source the following Vim9 script:
>
> --------------------------------------------------------------------------------------
> vim9script
>
> def Test()
> var a: dict<any> = {b: {}}
> a.b->extend({f1: 1,
> f2: 2})
> enddef
> v:errmsg = ''
> Test()
> echo v:errmsg
> --------------------------------------------------------------------------------------
>
> I get the "E116: Invalid arguments for function extend({f1: 1," error.
> If I pass the arguments to extend() in a single line, then it works
> without this error. Is this expected?
>
> Interestingly, this error doesn't abort the function and the error
> message is not displayed automatically. It is only set in the
> v:errmsg variable.
This happens when compiling the function, if you replace "Test()" with
"defcompile" you also get the error.
It happens when skipping over the expression, which happens without
evaluating, but that isn't checked at this point.
--
A cow comes flying over the battlements, lowing aggressively. The cow
lands on GALAHAD'S PAGE, squashing him completely.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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/20220110184030.9C5F51C04D4%40moolenaar.net.