Skip to content
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

Errors don't clear up after being fixed #139

Closed
lanzz opened this issue Sep 3, 2023 · 0 comments · Fixed by #141
Closed

Errors don't clear up after being fixed #139

lanzz opened this issue Sep 3, 2023 · 0 comments · Fixed by #141
Assignees

Comments

@lanzz
Copy link

lanzz commented Sep 3, 2023

from typing import Any

def foo(a: Any, b: Any) -> bool:
    return (a == b)

The above code fails with a "Returning Any from function declared to return "bool" (Mypy no-any-return)", which is understandable. The problem manifest once I fix it:

from typing import Any

def foo(a: Any, b: Any) -> bool:
    return bool(a == b)

The return statement remains annotated with the same error, even though it is fixed now. The error only goes away if I restart VScode. I can also delete the entire line, save, then re-add it, which will fix the return type error, but will leave me with a different stale error: "expected an indented block after function definition on line 4 (Mypy syntax)", which was raised while the row was deleted.

I'm running pre-release version v2023.3.12421009 because of the --show-error-code bug still not fixed on the stable channel. There are no obvious problems logged in the Mypy Type Checker output stream.

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