Annotated solution
Published September 29, 2026The solution
type If<Condition extends boolean, Then, Else> = Condition extends true ? Then : ElseThe common wrong answer
type If<Condition extends boolean, Then, Else> = boolean extends Condition ? Then : ElseAssignability has a direction. boolean is not assignable to the narrower literal true, so reversing the question selects the wrong branch.
Line by line
Condition extends true ? Then : ElseWith a literal condition the check has one answer, so only one branch survives.
Takeaway
A conditional type is an if whose question is assignability, and the left-to-right direction is part of the meaning.

