diff --git a/crates/red_knot_python_semantic/src/types.rs b/crates/red_knot_python_semantic/src/types.rs index d90567abff..c06fb29ecf 100644 --- a/crates/red_knot_python_semantic/src/types.rs +++ b/crates/red_knot_python_semantic/src/types.rs @@ -302,12 +302,7 @@ fn declarations_ty<'db>( let declared_ty = if let Some(second) = all_types.next() { let mut builder = UnionBuilder::new(db).add(first); for other in [second].into_iter().chain(all_types) { - // `Unknown` needs special handling, since we might infer `Unknown` - // for one of these due to a variable being defined in one possible - // control-flow branch but not another one. - if !first.is_equivalent_to(db, other) - || ((first == Type::Unknown) != (other == Type::Unknown)) - { + if !first.is_equivalent_to(db, other) { conflicting.push(other); } builder = builder.add(other);