Open
Description
I've found a case where a Callable
is not allowed when used directly, but is allowed if used as an alias
from typing import TypeVar, Callable
T = TypeVar('T')
MkFoo = Callable[[T], list[T]]
def foo(mkfoo: MkFoo) -> None:
_ = mkfoo(0)
works, but replacing MkFoo
by its definition
def foo(mkfoo: Callable[[T], list[T]]) -> None:
_ = mkfoo(0)
produces
main.py:13: error: Argument 1 has incompatible type "int"; expected "T"