Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
quit() fails with "unreachable statement after 'return'" #9832
The following fails to compile, giving:
echo "hello" quit() echo "goodbye"
Is this expected behavior?
If so, it might be worth mentioning in the documentation that
The error message could also be improved to
I agree with @timotheecour that early return/quit can be useful in debugging. My own preference would be for reachability checking to be disabled by default. Reachability cannot be fully checked anyway, since it is an undecidable property related to the halting problem.
Is there a way to disable reachability checking? I don't see one in the compiler docs. https://nim-lang.org/docs/nimc.html