From d47e9a60df8d29884713d545b8e66af8ca720f4b Mon Sep 17 00:00:00 2001 From: Douglas Creager Date: Fri, 5 Dec 2025 16:40:59 -0500 Subject: [PATCH] callable invariance rears its head again --- .../resources/mdtest/generics/pep695/paramspec.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md b/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md index f3d63d1689..77ff9a6954 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.md @@ -478,7 +478,8 @@ class C[**P]: def __init__(self, f: Callable[P, int]) -> None: self.f = f -def f(x: int, y: str) -> bool: +# Note that the return type must match exactly, since C is invariant on the return type of C.f. +def f(x: int, y: str) -> int: return True c = C(f)