We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
simple cases of unreachable code are not detected:
fn i32 test1(i32 n) { switch (n) { case 1: return 1; default: return 0; } return 2; } fn i32 test3(i32 n) { while (true) { return 1; } return 2; } fn i32 test4(i32 n) { for (;;) { return 1; } return 2; } fn i32 test5(i32 n) { while (true) { } return 2; } fn i32 test6(i32 n) { for (;;) { } return 2; } fn i32 test7(i32 n) { for (;;) { switch (n) { case 1: continue; default: return 0; } return 2; } return 3; } fn i32 test8(i32 n) { for (;;) { switch (n) { case 1: return 1; default: return 0; } } return 2; }
The compiler might also flag endless loops for (;;) {} and while (true) {}
for (;;) {}
while (true) {}
The text was updated successfully, but these errors were encountered:
Can you create a (failing) unit test for this? than send a pull request for that...
Sorry, something went wrong.
No branches or pull requests
simple cases of unreachable code are not detected:
The compiler might also flag endless loops
for (;;) {}
andwhile (true) {}
The text was updated successfully, but these errors were encountered: