Open
Description
Courtesy of @delfick
So if we have two files
# a.py
from typing import assert_never
import b
def switch[T_Choice: b.One | b.Two](choice: type[T_Choice]) -> None:
match choice:
case b.One:
print(1)
case b.Two:
print(2)
case _:
assert_never(choice)
switch(b.One)
and
# b.py
class One: ...
class Two: ...
Then I get no errors with mypy 1.15 and this error with 1.16
a.py:13: error: Argument 1 to "assert_never" has incompatible type "type[Two] | Never"; expected "Never" [arg-type]