Slide 7
Slide 7 text
extends Constraints on infer Type Variables
// Before (〜TS 4.6)
type FirstString =
T extends [infer S, ...unknown[]]
? S extends string
? S
: never
: never;
// After (TS 4.7)
type FirstString =
T extends [infer S extends string, ...unknown[]]
? S
: never;
Announcing TypeScript 4.7 RC ͔ΒҾ༻