Skip to content

Unreachable Warning Code #8190

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

Closed
llchan opened this issue Dec 20, 2019 · 1 comment · Fixed by #8312
Closed

Unreachable Warning Code #8190

llchan opened this issue Dec 20, 2019 · 1 comment · Fixed by #8312

Comments

@llchan
Copy link
Contributor

llchan commented Dec 20, 2019

There are sometimes cases where I'd like deliberately put something in a statically-unreachable section---maybe some asserts, maybe some debug info, etc.---in case it does hit that case at runtime. I currently silence them with a # type: ignore[misc] which isn't particularly informative to someone reading the code. Could we give unreachable its own dedicated error/warning code?

EDIT: just so it's clear, I do want to keep the warning on to detect legitimate issues.

@ilevkivskyi
Copy link
Member

Sure, PR is welcome!

Michael0x2a pushed a commit that referenced this issue Jan 23, 2020
Closes #8190. This introduces a new error code for errors shown when using
the `--warn-unreachable` flag, such as the "Statement is unreachable" error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants