TypeStat icon indicating copy to clipboard operation
TypeStat copied to clipboard

Incomplete union function types fixer doesn't wrap original function in parenthesis

Open JoshuaKGoldberg opened this issue 4 years ago • 2 comments

🐛 Bug Report

  • TypeStat version: 0.4.1
  • TypeScript version: 4.1.2
  • Node version: N/A

Actual Behavior

- let returnsEither: () => string;
+ let returnsEither: () => string | (() => number);

returnsEither = () => "";
returnsEither = () => 7;

Expected Behavior

The () => string should be wrapped in () too.

Reproduction

See ☝️

JoshuaKGoldberg avatar Dec 06 '20 20:12 JoshuaKGoldberg