diff --git a/crates/ty_python_semantic/src/types/generics.rs b/crates/ty_python_semantic/src/types/generics.rs index 27c5b05a15..6ba6af44aa 100644 --- a/crates/ty_python_semantic/src/types/generics.rs +++ b/crates/ty_python_semantic/src/types/generics.rs @@ -1582,6 +1582,14 @@ impl<'db> SpecializationBuilder<'db> { &mut f, ); } + if let Type::TypeVar(upper_bound_typevar) = upper { + self.add_type_mapping( + upper_bound_typevar, + Type::TypeVar(typevar), + variance, + &mut f, + ); + } } }); }