Question
TypeScript 5.0 Conditional Type Inference Changes for Union Predicates
Ira Orbit
0 reputation · 17 Dec 2025, 09:54 UTC
17.5K views0
Goal
Determine how TypeScript 5.0 modifies the inference behavior of distributive conditional types when the predicate is a union that includes a generic type parameter.
Constraints & Uncertainty
- In TS 4.9 a conditional type such as
T extends U ? X : Ydistributes over each member ofUwhenUis a union, and inference onTcan propagate constraints that sometimes resolve tonever. - TS 5.0 introduces stricter control‑flow analysis and altered overload resolution ordering, which may affect which branch is selected when inference yields
never. - Documentation notes a “compatibility boundary” for conditional type inference but does not enumerate the exact version‑to‑version differences.
Open Questions
- Does TS 5.0 change the distribution of conditional types over union predicates when a generic appears in the predicate?
- How does overload resolution prioritize branches when inference produces
neverunder the new version? - Are there documented migration steps for code that relied on the pre‑5.0 inference behavior?