don't pivot on never or object

This commit is contained in:
Douglas Creager 2025-12-07 14:38:19 -05:00
parent ecb9c1301b
commit 22c7fc4516
1 changed files with 6 additions and 2 deletions

View File

@ -2655,14 +2655,18 @@ impl<'db> SequentMap<'db> {
// (CL ≤ C ≤ pivot) ∧ (pivot ≤ B ≤ BU) → (CL ≤ C ≤ B) // (CL ≤ C ≤ pivot) ∧ (pivot ≤ B ≤ BU) → (CL ≤ C ≤ B)
(constrained_lower, constrained_upper) (constrained_lower, constrained_upper)
if constrained_upper == bound_constraint.lower(db) => if constrained_upper == bound_constraint.lower(db)
&& !constrained_upper.is_never()
&& !constrained_upper.is_object() =>
{ {
(constrained_lower, Type::TypeVar(bound_typevar)) (constrained_lower, Type::TypeVar(bound_typevar))
} }
// (pivot ≤ C ≤ CU) ∧ (BL ≤ B ≤ pivot) → (B ≤ C ≤ CU) // (pivot ≤ C ≤ CU) ∧ (BL ≤ B ≤ pivot) → (B ≤ C ≤ CU)
(constrained_lower, constrained_upper) (constrained_lower, constrained_upper)
if constrained_lower == bound_constraint.upper(db) => if constrained_lower == bound_constraint.upper(db)
&& !constrained_lower.is_never()
&& !constrained_lower.is_object() =>
{ {
(Type::TypeVar(bound_typevar), constrained_upper) (Type::TypeVar(bound_typevar), constrained_upper)
} }