add mapping for lower bound too

This commit is contained in:
Douglas Creager 2025-12-10 13:08:51 -05:00
parent f624bfdf63
commit 4bcca58c3a
1 changed files with 2 additions and 0 deletions

View File

@ -1571,6 +1571,8 @@ impl<'db> SpecializationBuilder<'db> {
let upper = constraint.upper(self.db);
if !upper.is_object() {
self.add_type_mapping(typevar, upper, variance, &mut f);
} else if !lower.is_never() {
self.add_type_mapping(typevar, lower, variance, &mut f);
}
if let Type::TypeVar(lower_bound_typevar) = lower {
self.add_type_mapping(