void () { doTest("(str) -> int", """ from typing import Callable, TypeVar S = TypeVar('S') T = TypeVar('T') def dec(t: T): def g(fun: Callable[[], S]) -> Callable[[T], S]: ... return g def func() -> int: ... expr = dec('foo')(func)"""); }