From 4643f3ff204142b24911a1c40e177812a6ce35b4 Mon Sep 17 00:00:00 2001 From: Douglas Creager Date: Tue, 9 Dec 2025 18:22:16 -0500 Subject: [PATCH] describe CannotSimplify results --- crates/ty_python_semantic/src/types/constraints.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ty_python_semantic/src/types/constraints.rs b/crates/ty_python_semantic/src/types/constraints.rs index 9c515f7c87..4225bb3a2f 100644 --- a/crates/ty_python_semantic/src/types/constraints.rs +++ b/crates/ty_python_semantic/src/types/constraints.rs @@ -2167,6 +2167,8 @@ impl<'db> InteriorNode<'db> { ); } + // If the intersection doesn't simplify to a single clause, we shouldn't update the + // BDD. IntersectionResult::CannotSimplify => {} IntersectionResult::Disjoint => { @@ -2758,7 +2760,12 @@ impl<'db> SequentMap<'db> { self.add_single_implication(db, intersection_constraint, right_constraint); self.enqueue_constraint(intersection_constraint); } + + // The sequent map only needs to include constraints that might appear in a BDD. If the + // intersection does not collapse to a single constraint, then there's no new + // constraint that we need to add to the sequent map. IntersectionResult::CannotSimplify => {} + IntersectionResult::Disjoint => { tracing::debug!( target: "ty_python_semantic::types::constraints::SequentMap",