main.py:10: note: Revealed type is "Literal[__main__.Op.A]"
main.py:13: note: Revealed type is "Literal[__main__.Op.B]"
main.py:10: note: Revealed type is "__main__.Op"
main.py:13: note: Revealed type is "Literal[__main__.Op.B]"
main.py:16: error: Argument 1 to "assert_never" has incompatible type "Literal[Op.A]"; expected "Never" [arg-type]
Bug Report
mypy incorrectly calculates the type of emun if its value is checked with
tuple().__contains__in "if" clause.To Reproduce
https://gist.github.com/mypy-play/e316d3d5b495cb113cacc9c55136dea7
Expected Behavior
Actual Behavior
Pyright works fine with it - https://pyright-play.net/?code=JYWwDg9gTgLgBAUwHYFcQChSVnGBPMYJAc3XQGMAbAQwGda4B5MACmTQDoBRVEASgBc6OCLgBBOAF44AImozhogEJTZAIwXoAJggBmcKCiQsIYAUzCDFI4PtNwicFsw5iANFdFfcBIsQ5QCABuCNSUAPr4YAgmltbegTAoUEjxCJS2cPaS0i5KQt6iUX4BwaERUTGmfPFeicmpXum0CAWFPoQkHHQtsOFIZVCxNUA.
Your Environment
mypy.ini(and other config files):