Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptvariadic tuple typesSingle-choice MCQ

Why does the curried `concat` below fail to produce the precise tuple `[1, 2, 3, 4]` and instead widen, and what about variadic-tuple inference causes it?

declare function concat<T extends unknown[], U extends unknown[]>( a: [...T], b: [...U] ): [...T, ...U]; const r = concat([1, 2], [3, 4]);