does someone faced <this issue> as well with kotli...
# arrow
m
does someone faced this issue as well with kotlin native? perhaps I’m missing some hotfix for a know issue? 🤔
s
Are
Get
and
Put
here
@JvmInline value class
?
m
nope, they arent, but good point
actually
Put
can’t, has 2 params
s
What happens if you add an
else
and print
q
. What is printed?
I've had issues where the runtime value was not what was expected, and thus the when ran into no branch since under the hood you're doing a bunch of instance checks
m
ArcherRaise(raise=0)
where it should be
Get(key=0)
s
Yeah, somewhere the order of the params of the functions are mangled or something like that..
Try using non-operator, or without extension receiver or both.
One of those should fix it
m
ArcherRaise(raise=0)
does not even make sense ist just a delegate of Raise<F>
i come from the non receiver one, using receiver is an experiemnt to emulate CR
non-operator?
s
named function instead of
invoke
m
ah, good one, let me se…
y
Also check if you're calling this function from JS or from a different module or something like that. I'd say try calling it in test code for the same module and see if that fixes the issue (which might be a weird compiler incomparability thing I guess)
Also, is
ArcherRaise
a value class? Try making it a normal class and see if that helps
👀 1
🙌 1
m
removing ArcherRaise @JvmInline from
ArcherRaise
made the trick. Thank you!
y
Woohoo 🎉🎉!!! My guess then is that the compiler was wrapping
q
in an
ArcherRaise
for some reason, which is what produced that weird output. Maybe compare the JS generated code of both and see what happened there. It'd be really good to also report it if you can get a reproducer at kotl.in/issue
m
cool, will try to come with it, Thank you @Youssef Shoaib [MOD] and @simon.vergauwen