Course contentsShow
← TypeScript
Lesson 978 of 1,79622. The never TypeFree lesson

Distribution and never Propagation

How distributive conditional types handle never inputs and how never propagates through type operations.

Distribution and never Propagation

What you'll learn: How distributive conditional types behave when they encounter never as input, and how never propagates through type operations.

The Core Concept

When you work with distributive conditional types (those that process union types member-by-member), passing never as input creates a special case. Instead of checking if never extends SomeType, the conditional type short-circuits and immediately returns never without ever evaluating the true or false branches.

This happens because never represents an empty union — a union with zero members. When a distributive conditional tries to iterate over the members of an empty union, there's nothing to iterate over, so the result is simply never.

How Distribution Treats never

Imagine a conditional type like:

type WrapInArray<T> = T extends any ? T[] : never;

For normal types, this distributes:

  • WrapInArray<string | number> → string[] | number[]

But with never:

  • WrapInArray<never> → never

The type doesn't evaluate to never[] (which would be the false branch). Instead, it returns never immediately because there are no union members to process.

Preventing Distribution to Force Evaluation

If you want to actually check never as a value rather than treating it as an empty union, wrap it in a tuple to disable distribution:

type IsNever<T> = [T] extends [never] ? true : false;

type Test1 = IsNever<never>;  // true (works!)
type Test2 = IsNever<string>; // false

Without the tuple wrapping, a distributive check would return never instead of true.

Propagation Through Operations

When never appears in type operations, it typically propagates and "infects" the result:

  • Union with never: string | never → string (never is absorbed)
  • Intersection with never: string & never → never (produces impossibility)
  • Mapped types over never: produce empty objects or collapse to never

Think of never as a "type black hole" in intersections — nothing can satisfy both "some type" and "no type," so the result collapses.

Key Takeaway: In distributive conditional types, never as input skips evaluation entirely and returns never; to check if a type is never, disable distribution with tuple wrapping like [T] extends [never].