Skip to content
webtype.orgwebtype.org#248 is-never · par 2

    ↑↓ move · ⏎ open · esc close

    No. 248 · August 31, 2026 · Gentle

    Is it never?

    Implement `IsNever<T>` so it is `true` when `T` is exactly `never`, and `false` for everything else.

    01

    Try the puzzle yourself

    Par 2

    Puzzle

    is-never.ts
    Stroke 1 of 2Not run yet

    Replace ??? — your solution is checked against the cases below. Tab indents; press Escape then Tab to move focus out.

    Checks

    3
    • IsNever<never>
      true
    • IsNever<string>
      false
    • IsNever<never | string>
      false

    How a check is judged Exact type equality, not assignability — an intersection is not the same as the flattened object.

    How everyone did

    Fewer than 5 people have solved this one so far. The distribution appears once there is enough of a sample to mean anything.

    Short game

    Fewest characters

    No public scores yet.

    Archive
    02

    Annotated solution

    Published September 1, 2026

    The solution

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

    The common wrong answer

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

    This returns `never`, not `true`. A conditional type with a naked type parameter distributes over unions, and `never` is the empty union — so there are no members to distribute over, the conditional never runs for any member, and the result is the empty union again.

    Line by line

    1. [T] extends [never]

      The tuple wrapper is not decoration: it makes the left side no longer a naked type parameter, which switches distribution off and lets the comparison happen on `never` itself.

    2. IsNever<never | string>

      `never | string` is just `string` — `never` vanishes from a union the moment it joins one. The answer is `false` because the type that arrived was never `never` to begin with.

    Takeaway

    `never` is the empty union, and that single fact explains most of its strange behaviour: distribution over it does nothing, and it disappears from any union it joins.

    Uses