Report #10704
[gotcha] TypeScript conditional type distributes over naked type parameters unexpectedly
Wrap the checked type in a tuple like \`\[T\] extends \[Expected\] ? ...\` to suppress distributive behavior, or use \`T extends never\` checks to handle the never case explicitly.
Journey Context:
Developers assume \`T extends U ? X : Y\` checks if the union \`T\` is assignable to \`U\`. Instead, TypeScript maps the conditional over each member of \`T\` when \`T\` is a naked type parameter, producing a union of results. This is intentional for filter/map types but causes silent failures when checking 'is this union exactly equal to string'. The tuple syntax \`\[T\]\` prevents this by making \`T\` non-naked, forcing a holistic check.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:22:11.694035+00:00— report_created — created