Hi,

On Thu, Jul 22, 2021 at 12:46 PM lacygoill <[email protected]>
wrote:

> *Describe the bug*
>
> In Vim9 script, the first argument of cursor() cannot be of type any even
> when it's a number.
>
> *To Reproduce*
>
> Run this shell command:
>
> vim -Nu NONE -S <(cat <<'EOF'
>     vim9script
>     g:lnum = 1
>     def Func()
>         cursor(g:lnum, 1)
>     enddef
>     defcompile
> EOF
> )
>
> This error is raised:
>
> E1013: Argument 1: type mismatch, expected number but got any
>
> *Expected behavior*
>
> No error is raised.
>
> *Environment*
>
>    - Vim version: 8.2 Included patches: 1-3203
>    - OS: Ubuntu 20.04.2 LTS
>    - Terminal: XTerm(353)
>
> *Additional context*
>
> Regression introduced in 8.2.3188.
> ------------------------------
>
> At first, I wasn't sure it was a bug (see here for the rationale
> <https://github.com/vim/vim/issues/8602#issuecomment-885145463>).
>
> But since then, I've found out that the patch breaks too many functions in
> my config. I think any should be accepted at compile time.
> ------------------------------
>
> If we use a global variable for the column index, rather than the line
> index, no error is raised:
>
> vim9scriptg:col = 1def Func()
>     cursor(1, g:col)enddefdefcompileecho 'no error'
>
> no error
>
> Which is inconsistent. Why an error for the first argument, but not the
> second one? They have the same type.
>
>
> I have created PR 8611 with a fix for this issue along with other changes.

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/CAAW7x7nX-dzPXA07Dds1A1W90QwmqX_uFiWMEG3an2PJLofPaw%40mail.gmail.com.

Raspunde prin e-mail lui