Describe the bug
vim9script def Foo(n: number): void var bar = {'9': 'a', 'x': 'y'} echomsg bar->has_key(n) enddef Foo('9')
Expected behavior
looks n was treated as 'string' (when has_key) in the past implicitly, but recently change made it raise e1013 err.
Environment (please complete the following information):
v8.2.3140
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
doc:
A key is always a String. You can use a Number, it will be converted to a
String automatically. Thus the String '4' and the number 4 will find the same
entry.
btw:
we had such has_key() underscore naming, but mostly we should keep sth like haskey(), looks that's the right vim style... :-)
Foo() needs to be called with a number argument. That didn't change recently, so perhaps it's a mistake in your example.
The argument of has_key() was just changed in patch 8.2.3142, thus I think this problem was already fixed.
Closed #8546.
ok, yes, 8.2.3142 fixed it about 1 hour ago. thx.
Hah, we are used to telling users reporting a problem that their version is half a year old and suggest trying a more recent one.
Now it's down to half an hour :-).
um, i think the problem is not about 'age' or 'old', but the test case did not cover the cases, or sometimes we knew some changes obviously would break user cases.. or some changes changed the behavior too heavy (impacted lot), otherwise we would not release the change because the ci should had stopped the process already. :-)
actually in the real life/work we faced the same issue -- so called 'agile', specially e.g only req 1 deployment into 1 data center,
actually i missed the 'version', not sure if someone had better solution/suggestion.
btw: e1013 check type looks very strict, or something perhaps wrong,
vim9script call sign_define([ \ {'name': 'sign1', \ 'text': '=>'}, \ {'name': 'sign2', \ 'text': '!!'} \ ]) def Bar(): void sign_define([{'name': 'sign1', \ 'text': '=>'}, \ {'name': 'sign2', \ 'text': '!!'} \ ]) enddef Bar()
if you like i can open a separate ticket, or here this type checking problem was not just about some specific funcs (e.g has_key(), sign_define()) ?
btw:
e1013check type looks very strict, or something perhaps wrong,vim9script call sign_define([ \ {'name': 'sign1', \ 'text': '=>'}, \ {'name': 'sign2', \ 'text': '!!'} \ ]) def Bar(): void sign_define([{'name': 'sign1', \ 'text': '=>'}, \ {'name': 'sign2', \ 'text': '!!'} \ ]) enddef Bar()if you like i can open a separate ticket, or here this type checking problem was not just about some specific funcs (e.g has_key(), sign_define()) ?
and this one after 8545
var popupID = text->popup_atcursor({moved: 'any'})
expected string but got any
—
You are receiving this because you commented.
and this one after 8545
var popupID = text->popup_atcursor({moved: 'any'})
expected string but got any
@brammool @yegappan
bnr->setbufvar('&buflisted', true)
// "expected string but got bool"
doc:
In Vim9 script one can use "true" for v:true, "false" for v:false and "null"
for v:null.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
![]()
@brammool @yegappan
bnr->setbufvar('&buflisted', true)
// "expected string but got bool"
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
the base is passed as the third argument
maybe not a good idea, since most the first argument was the base,
and actually this case is from your lsp plugin, so looks you were confused too...... :-)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
the base is passed as the third argument
maybe not a good idea, since most the first argument was the base,
and actually this case is from your lsp plugin, so looks you were confused too...... :-)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
ok, but unfortunately, it's raising error when it's really called.
so 'used as a method' this is a case to prove this would code be confused.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.