Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 467 Bytes

File metadata and controls

16 lines (12 loc) · 467 Bytes

Fix parens in inferred function return types with extends (#14279 by @fisker)

// Input
type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never;

// Prettier stable (First format)
type Foo<T> = T extends (a) => a is infer R extends string ? R : never;

// Prettier stable (Second format)
SyntaxError: '?' expected. 

// Prettier main
type Foo<T> = T extends ((a) => a is infer R extends string) ? R : never;