-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
unreachable
error not triggered when unreachable line calls function with NoReturn
return type
#10916
Labels
Comments
if False:
raise Exception("AMONGUS") # no error 😳 |
This looks to be the same issue as #11437 |
This is intentional, so that you can write a runtime assertion that fails if the types are wrong and the code is unexpectedly reached at runtime. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://mypy-play.net/?mypy=latest&python=3.10&flags=show-column-numbers%2Cshow-error-codes%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=cf13f42a0c2fb1ba0642346905e3fd27
The text was updated successfully, but these errors were encountered: