Skip to content

Maybe union type ordering error #5320

@dylanapplegate

Description

@dylanapplegate

Expected Result
Maybe union types can be specified in any order:
?(Array<T> | T)
?(T | Array<T>)

Actual Result
The ordering does matter. Specifying the array first works correctly. While including the generic first causes an error.

I first noticed this error in React using flow version 0.53.1, but the examples provided above are for v0.59.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions