void () { doTest("int", """ from typing import Protocol class Fooable[T1](Protocol): def foo(self) -> T1: ... class Super[T2]: def foo(self) -> T2: ... class MyClass[T2](Super[T2]): pass def f[T1](x: Fooable[T1]) -> T1: ... obj: MyClass[int] expr = f(obj)"""); }