void () { doTest("int", """ from typing import Callable, Generic, TypeVar T = TypeVar('T') class Super(Generic[T]): pass class Sub(Super[T]): pass def f(x: Callable[[Sub[T]], None]) -> T: pass def g(x: Super[int]): pass expr = f(g)"""); }