You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some issues to consider. What would it mean for this:
local x: string
The reason this type is NIL or string today is that above is valid, and creates a local with NIL value to start with.
If we change this then every such local variable will need to be initialized to type specific default value.
Okay for strings maybe but what is the default value for userdata? Or function?
Perhaps we should leave existing declaration semantics as union of NIL + type, but add new syntax for function arguments where stronger assertion is needed. Also @type operator could be strong assertion.
Hello.
Let's summarize our discussion on that.
Nowadays Ravi lacks of support optional annotated function arguments.
For example, you can't do thing like that:
Of course, you can use
any
type, but then you have to add additional type check inside function to ensure that third argument is a integer.Alternatively (or simultaneously☺), it can be implemented with Union types:
The text was updated successfully, but these errors were encountered: