I saw some recent msgs about comparing anything to null, and that it would be allowed. I guess I got the wrong impression. Using vim: "Included patches: 1-4507"

In my first vim9 script, I did (the real code conditionally return null)

   def Get(): string
        return null
   enddef

And this doesn't compile because "Type mismatch; expected string but got special".

Allowing null seems like an improvement.

In my case, I can do "def Get(): any", but then there's a runtime checking.

Would allowing it to be null incur some additional runtime check? The following fails at runtime, so that can't be it entirely:

   var xxx = 'foo'
   xxx = 'bar'
   xxx = null

I guess how to handle a "null string" might be part of the issue. In my case, when the value is null, it only gets used in a comparison.

-ernie

PS I could file this for consideration, if it would be useful.

--
--
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/f3ff7e62-1575-457c-040a-a52c2dad52b6%40raelity.com.

Raspunde prin e-mail lui