Yegappan wrote:
> The following sample code throws E1013 error in line 10 with Vim9:
>
> ============================================
> vim9script
>
> def Test()
> var notif: dict<any> = {}
> var docID: dict<any> = {}
> var changeSet: list<dict<any>>
>
> docID.uri = 'buf'
> changeSet->add({text: ['one']})
>
> notif.params = {}
> notif.params->extend({textDocument: docID})
> notif.params->extend({content: changeSet})
> enddef
>
> call Test()
> ============================================
>
> This used to work till recently.
The error is:
1013: Argument 2: type mismatch, expected dict<dict<string>> but got dict<list<
dict<list<string>>>>
extend() is now checking that the dictionary does not change type.
In this case the dict members are of mixed type. Not sure if we should
somehow not check the type. You can use extendnew() at least.
Or use one extend() instead of two:
notif.params = {}
notif.params->extend({textDocument: docID, content: changeSet})
--
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/202102071943.117Jh0aU2925164%40masaka.moolenaar.net.