Intersecting with never
What you'll learn: Why any intersection containing never always collapses to never, and what that means for your types.
The Mathematical Reality of never
never represents values that cannot exist. When you create an intersection type, you're saying "I want a type that is both A and B simultaneously."
When one of those types is never — the impossible type — you're asking for something that is both "some actual type" and "impossible" at the same time. That's a contradiction, so the result is always never.
Practical Examples
type StringAndNever = string & never; // never
type ObjectAndNever = { name: string } & never; // never
type AnyAndNever = any & never; // never (even any!)
No matter what type you intersect with never, the result is never. Even any, which normally absorbs everything, becomes never when intersected with it.
Why This Matters
This rule helps you understand type conflicts:
type ConflictingProps = { id: string } & { id: number };
// Same as: { id: string & number }
// Which is: { id: never }
When properties conflict with incompatible types, their intersection becomes never, signaling an impossible type.
The Absorbing Property
Think of never as a "black hole" for intersections — it absorbs everything. This is the opposite of union types, where never disappears (you'll learn that pattern later).
Key Takeaway: Any intersection containing never always results in never because you cannot have a value that is both something real and impossible at the same time.