Error on passing void to proc with explicitly specified argument type
KanoAlgiz opened this issue ยท 2 comments
Stacktrace: https://pastebin.com/0PiDEg5C
CH build #3945
Example:
proc _is_alive(string @pl){ return(true) }
_is_alive(void)
Void should not be used for anything other than defining a return type. It should however not result in an error in core, but rather in a typing error. I believe the best way to add a fix for this is through adding a static type checker, but a fix for the dynamic checks on this could be a good short term solution.
void is a falsey value, so it is useable in general, though it would never make sense to explicitly type an input parameter as void, it isn't an error either. In any case, the solution for both the static checker and the runtime checker will be the same logic, so I'm going to fix this in the existing dynamic check.