Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Closed
Description
Hi,
I continued looking at how the codebase I work on responds to the upcoming mypy 1.16 release and I believe I found another bug
importdatetimeimportenumfromtypingimportassert_neverclassValueType(enum.Enum):BOOLEAN=boolDATE=datetime.dateDATETIME=datetime.datetimevalue_type:ValueType=ValueType.BOOLEANmatchvalue_type:caseValueType.BOOLEAN:passcaseValueType.DATE:passcaseValueType.DATETIME:passcase _:assert_never(value_type)
On mypy 1.16 I get this error
a.py:22: error: Argument 1 to "assert_never" has incompatible type "ValueType"; expected "Never" [arg-type]As far as I can tell this should be correct and I'm unsure why it doesn't think I have an exhaustive match.
Your Environment
- Mypy version used: release-1.16 (revision96525a2, built locally with mypy_mypyc-wheels for cp312-macosx_arm64)
- Mypy command-line flags:
mypy a.py - Mypy configuration options from
mypy.ini(and other config files): no config - Python version used: python3.12