check lower/upper bounds in satisfied_by_all_typevars

This commit is contained in:
Douglas Creager 2025-11-23 16:20:20 -05:00
parent fe19d2de21
commit 221507f828
1 changed files with 6 additions and 0 deletions

View File

@ -1051,6 +1051,12 @@ impl<'db> Node<'db> {
let mut typevars = FxHashSet::default();
self.for_each_constraint(db, &mut |constraint| {
typevars.insert(constraint.typevar(db));
if let Type::TypeVar(bound_typevar) = constraint.lower(db) {
typevars.insert(bound_typevar);
}
if let Type::TypeVar(bound_typevar) = constraint.upper(db) {
typevars.insert(bound_typevar);
}
});
// Returns if some specialization satisfies this constraint set.