Closed
Description
from typing import TypeVar, Generic, Callable
_Tco = TypeVar('_Tco', covariant=True)
class Thing(Generic[_Tco]):
def chain(self, func):
# type: (Callable[[_Tco], None]) -> None
pass
def end(self):
# type: () -> None
return self.chain(lambda _: None)
example.py: error: Cannot use a covariant type variable as a parameter
This error has no associated line number. (If the lambda is expanded into an explicit inner function typed as (_Tco) -> None
, the line number is present.)