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
Additional context
Regression introduced in 8.2.3188.
At first, I wasn't sure it was a bug (see here for the rationale).
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:
vim9script g:col = 1 def Func() cursor(1, g:col) enddef defcompile echo 'no error'
no error
Which is inconsistent. Why an error for the first argument, but not the second one? They have the same type.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Probably fixed in 8.2.3206
—
You are receiving this because you commented.