You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest 1.1.1 build of Mypy I've started getting various errors such as 'code is unreachable' or 'statement is always true' around certain uses of dataclasses.is_dataclass(). It seems to happen when the argument to is_dataclass() is a type.
Mypy should not assume is_dataclass() always returns True when passed a type.
Actual Behavior
Mypy assumes is_dataclass() always return True when passed a type.
Your Environment
Seeing the error in Mypy 1.1.1 from home-brew on a Mac. 1.1.1 does not seem to be available on the playground but the 'mypy-master-branch' currently exhibits the error.
The text was updated successfully, but these errors were encountered:
Apologies for the regression. This has already been fixed in 4ca0c48, but the fix didn't make it into mypy 1.1.1. It's possible mypy will be willing to make a patch release for this.
Bug Report
In the latest 1.1.1 build of Mypy I've started getting various errors such as 'code is unreachable' or 'statement is always true' around certain uses of dataclasses.is_dataclass(). It seems to happen when the argument to is_dataclass() is a type.
To Reproduce
Here is a playground demonstrating the issue:
https://mypy-play.net/?mypy=master&python=3.11&flags=warn-unreachable&gist=5001f76768535e01b95e69dd2c47a916
If you run it with mypy 1.0.0 it passes, but with mypy master branch it says the 'not-dataclass' path cannot be reached.
The code:
Expected Behavior
Mypy should not assume is_dataclass() always returns True when passed a type.
Actual Behavior
Mypy assumes is_dataclass() always return True when passed a type.
Your Environment
Seeing the error in Mypy 1.1.1 from home-brew on a Mac. 1.1.1 does not seem to be available on the playground but the 'mypy-master-branch' currently exhibits the error.
The text was updated successfully, but these errors were encountered: