from typing import Type
class A:
pass
def deco(cls) -> Type[A]:
return A
@deco
class B:
pass
def func(cls: Type[A]):
assert cls is A
func(B)
Running mypy on that code causes this error:
hoge.py:16: error: Argument 1 to "func" has incompatible type "B"; expected Type[A]
mypy version is mypy 0.511-88e8ef28be2465d1693ace4d39cd422987a97220-dirty.
I would expect it to correctly detect the type of B.