Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptcompiler-performance blowupsSingle-choice MCQ

Why can adding a single, seemingly harmless property to a large discriminated union cause a quadratic (or worse) blowup in `tsc` checking time at usage sites?

// A union with ~50 members; each `process(u)` exhaustively narrows via switch. type U = A1 | A2 | /* ... */ | A50; function process(u: U) { /* switch on u.kind across all members */ }