diff --git a/crates/red_knot_python_semantic/src/types.rs b/crates/red_knot_python_semantic/src/types.rs index b6a99c9acd..8c6e2e7c47 100644 --- a/crates/red_knot_python_semantic/src/types.rs +++ b/crates/red_knot_python_semantic/src/types.rs @@ -496,11 +496,9 @@ impl<'db> Type<'db> { tuple.elements(db).is_empty() } Type::Union(..) => { - // There are some rare edge cases where a union type might be a singleton type. - // For example, a union with just one element (which itself is a singleton). Or - // a union with an empty type (e.g. Never | None). Here, we assume that such - // types would have been simplified to a different representation earlier and - // simply return false. + // A single-element union, where the sole element was a singleton, would itself + // be a singleton type. However, unions with length < 2 should never appear in + // our model due to [`UnionBuilder::build`]. false } Type::Intersection(..) => {