Skip to content

Missing parentheses when printing a TS arrow function type in a union #17123

@nicolo-ribaudo

Description

@nicolo-ribaudo

💻

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

type a = b | (() => c);

Configuration file name

No response

Configuration

No response

Current and expected behavior

Babel prints it as

type a = b | () => c;

But it should preserve the parehtneses

Environment

/

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions