Bug Report
Hi! I've just installed mypy 2.1.0 and tried it against the snippet posted for the issue 16093 (#16093 (comment)).
It seems that the change is still not active in mypy 2.1.0?
The changelog states that the fix was implemented in 2.1.0:
https://mypy.readthedocs.io/en/stable/changelog.html#other-notable-fixes-and-improvements
Notably:
#21456
To Reproduce
Here's the content of the exact snippet I ran mypy on, just for reference:
fromenumimportEnumfromtypingimportassert_neverclassMyEnum(Enum):
A=1B=2C=3defmy_function(a: MyEnum) ->bool:
ifa==MyEnum.A:
returnTrueelifain (MyEnum.B, MyEnum.C):
returnFalseassert_never(a)
my_function(MyEnum.A)
Expected Behavior
I expected no error.
Actual Behavior
I get:
scratch_6.py:16: error: Argument 1 to "assert_never" has incompatible type "Literal[MyEnum.B, MyEnum.C]"; expected "Never" [arg-type] Found 1 error in 1 file (checked 1 source file)
Your Environment
$ mypy --version
mypy 2.1.0 (compiled: yes)
Command line:
mypy --strict scratch_6.py
Bug Report
Hi! I've just installed mypy 2.1.0 and tried it against the snippet posted for the issue 16093 (#16093 (comment)).
It seems that the change is still not active in mypy 2.1.0?
The changelog states that the fix was implemented in 2.1.0:
https://mypy.readthedocs.io/en/stable/changelog.html#other-notable-fixes-and-improvements
Notably:
#21456
To Reproduce
Here's the content of the exact snippet I ran mypy on, just for reference:
Expected Behavior
I expected no error.
Actual Behavior
I get:
Your Environment
Command line: