void () { assertTypeParameterOwner("f.intermediate.g", "f", """ from typing import Generic, TypeVar T1 = TypeVar('T1') def f(x: T1) -> None: def intermediate(x: T1) -> T1: def g(x: T1) -> T1: ... """); }