-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using "void"-functions as arguments leads to "Illegal expression type" #70
Comments
I'd say this is a valid error. Perhaps the error message should be more explicit, but I think it should fail, regardless of what legacy bcc does. |
If course I think NG is allowed to error on more things - as long as it explains why it is failing. Do not misunderstand me: I know that the issues are errors in my code :p |
While "return a(1)" is a valid error - shouldnt a subtraction of "void" result in something like 0? No ... I am not "joking" (albeit I started this comment to write something not that serious) The function b:int() returns an integer value. When doing the math operation of "void - void" you should end up with "0", same for "void/void" = "1". I mean, these are rare special cases and really constructed ... but maybe there are more cases of "math(void)" returning real mathematic values. I still understand, that the above is something really "constructed" and no real-world-scenario. |
If you are using Strict, then you can do what you like. In legacy BlitzMax, all functions return at least Int, regardless of strictness. C doesn't let you mix and match, and it turns out that emscripten really doesn't like you doing "fun" things with inappropriately mixed function signatures. (You may consider emscripten to be ReallySuperStrict)
|
Like said: I am totally open for just not allowing void as result for something different ... stay tuned for next issues :p You may close this issue when introducing an error-message ("invalid return type"). |
Fails with "Illegal expression type" on the Return a(1) - a(2)_ call. On Vanilla it compiles and would return "0".
The text was updated successfully, but these errors were encountered: