diff --git a/crates/ty_python_semantic/src/types/narrow.rs b/crates/ty_python_semantic/src/types/narrow.rs index d5a1373f6b..811a50cbec 100644 --- a/crates/ty_python_semantic/src/types/narrow.rs +++ b/crates/ty_python_semantic/src/types/narrow.rs @@ -349,7 +349,7 @@ impl<'db> Conjunction<'db> { #[derive(Hash, PartialEq, Debug, Eq, Clone)] struct NarrowingConstraint<'db> { /// Disjunction of conjunctions (DNF) - disjuncts: SmallVec<[Conjunction<'db>; 4]>, + disjuncts: SmallVec<[Conjunction<'db>; 1]>, } impl get_size2::GetSize for NarrowingConstraint<'_> {} @@ -524,10 +524,8 @@ fn merge_constraints_or<'db>( .disjuncts .extend(from_constraint.disjuncts.clone()); } - Entry::Vacant(entry) => { - // Place only appears in `from`, not in `into`. - // Widen to object since the other branch doesn't constrain it. - entry.insert(NarrowingConstraint::regular(Type::object())); + Entry::Vacant(_) => { + // Place only appears in `from`, not in `into`. No constraint needed. } } }