-
-
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
mypy stops reporting errors when reveal_type
is called
#6748
Comments
Yes, this is definitely a bug. We had a similar issue before, caused by the fact that mypy considers all statements after an inferred |
I can't reproduce the errors the OP is seeing, even on mypy 0.701. I'm going to close this, but feel free to reopen if you have an example demonstrating this issue on the latest release. |
Nothing simpler:
|
I don't have the power to reopen the issue, but … seems like the problem is still there. |
Even weirder (conceivably related?):
|
it's a caching issue:
|
Consider the following code; the relevant part is in
map()
but the rest is included for completeness:As given, (a) and (b) are commented out and (c) is not. If I run mypy (0.701) over it, it complains:
If (c) is commented out and (b) is uncommented, mypy complains like so:
This is already strange: I would have expected
return EXPR
andNAME = EXPR; return NAME
to be the same.But! If I uncomment (a), then the only output is
I.e., it no longer finds a type error. This is true regardless of whether (b) or (c) is uncommented!
The text was updated successfully, but these errors were encountered: