Hi,

On Sun, Jul 11, 2021 at 11:34 AM lacygoill <[email protected]>
wrote:

> *Describe the bug*
>
> In Vim9 script, we cannot pass an argument of type any to popup_create().
>
> *To Reproduce*
>
> Run this shell command:
>
> vim -Nu NONE -S <(cat <<'EOF'
>     vim9script
>     def Func()
>         var what: any = ''
>         popup_create(what, {})
>     enddef
>     defcompile
> EOF
> )
>
> This error is given:
>
> E1013: Argument 1: type mismatch, expected string but got any
>
> *Expected behavior*
>
> No error is given.
>
> *Environment*
>
>    - Vim version: 8.2 Included patches: 1-3151
>    - OS: Ubuntu 20.04.2 LTS
>    - Terminal: XTerm(353)
>
> *Additional context*
>
> The {what} argument of popup_create() can be many things; including a
> number or a string. Thus, it makes sense to use a variable of type any
> for the first argument of popup_create().
> ------------------------------
>
> No error is given at the script level:
>
> vim9scriptvim9scriptvar what: any = ''popup_create(what, {})echo 'no error'
>
> no error
>
> Which is inconsistent.
> ------------------------------
>
> If we give a number in compiled code, no error is given:
>
> vim9scriptdef Func()
>     popup_create(123, {})enddefdefcompileecho 'no error'
>
> no error
>
> It means that Vim is ok with us giving a number to popup_create(). But
> that's not what the first error message said:
>
> E1013: Argument 1: type mismatch, expected string but got any
>                                   ^-------------^
>
>
>
I have created PR #8551 to address this issue.

Regards,
Yegappan

-- 
-- 
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/CAAW7x7kbYLMBj7SQ7Y5KbRAtbD3xShWyau6R5C-U39g5ySG7oQ%40mail.gmail.com.

Raspunde prin e-mail lui