From a6e6bfc978d4251321ffb613f7a876e86e2f5508 Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 4 Dec 2024 11:00:24 +0100 Subject: [PATCH] Remove special Type::Unknown handling --- crates/red_knot_python_semantic/src/types.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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);