typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Extra parentheses added when type assertion is used in arrow function with object literal

Open dragomirtitian opened this issue 2 weeks ago • 0 comments

Steps to reproduce

let fn = (s: number) => ({ s } as {});

Behavior with [email protected]

Emit to:

let fn = (s) => ({ s });

Behavior with tsgo

Extra pair of parentheses added to emit:

let fn = (s) => (({ s }));

dragomirtitian avatar Dec 10 '25 18:12 dragomirtitian