never as an Impossible Intersection
What you'll learn: How TypeScript uses never to signal when you've created a type that's logically impossible.
When you intersect two types that have no values in common, TypeScript resolves the intersection to never. This happens because there's literally no value that could satisfy both types at once—it's mathematically impossible.
Understanding Impossible Intersections
Think of an intersection as "must be both A and B simultaneously." When you try to intersect conflicting primitive types, you're asking for something that can't exist:
type ImpossibleString = string & number;
// Type resolves to: never
let value: ImpossibleString;
// You cannot assign anything to this variable!
A value can't be a string and a number at the same time, so TypeScript tells you this type is never—nothing can ever inhabit it.
Real-World Example
This often surfaces when combining literal types incorrectly:
type LeftAlign = "left";
type RightAlign = "right";
type BothAlignments = LeftAlign & RightAlign;
// Type is: never
let alignment: BothAlignments;
// Error: Can't assign anything - no value is both "left" AND "right"
Why This Matters
Seeing never from an intersection is TypeScript's way of saying "you've made a mistake in your type logic." It's a compile-time guard that prevents you from creating nonsensical type constraints. If you encounter never unexpectedly, check your intersection logic—you're probably combining incompatible types.
This is different from a union (string | number), which means "either/or" and works perfectly fine.
Key Takeaway: When incompatible types intersect, TypeScript resolves them to never, signaling an impossible constraint and catching logical errors before runtime.