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
Make "unreachable statement" error a warning #240
Comments
'If true: quit' is good enough |
Yeah, however, |
+1 |
|
This: proc a() =
quit(0)
block: echo "hi"
a() currently compiles without error, which is a bit illogical, but if we were to fix it so that it errors it would be a breaking change. |
Currently code like
would not compile with the error
unreachable statement after 'return' statement or '{.noReturn.}' proc
. I propose to make it a warning instead, which will still be quite visible to the developer but it'll allow for faster prototyping in some cases.Please comment, I might not know some cases where this can lead to new bugs or unintended behaviour.
Also see nim-lang/Nim#14190 because it's a bit similar in a sense that this PR made it possible to have unreachable
else
branch in a case statement.The text was updated successfully, but these errors were encountered: