-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
No check when a function expects a return value #515
Comments
If you don't specify, it probably returns the null case, or 0 for You're correct though, you should have some return statement if your function returns. |
This is actually an interesting Formal Verification problem, for methods with lots of branches, is there a branch that does not return a value? |
It gets even more fun if we force all branches to end in |
Well, the easiest way to start is to just But for future Formal Verification, we would implement a routine to check the program branches all contain a return statement and catch it at compile time instead of during runtime, as the above solution would provide (basically allowing us to remove the |
Closing in favour of #590 |
What's your issue about?
Compiler should reject the following program
because
foo
expects a return value of typenum
, however the current compiler still compiles.How can it be fixed?
Need to keep track of the return type of each branch.
Cute Animal Picture
The text was updated successfully, but these errors were encountered: