Skip to content

Conditional type distribution leads to undesirable behavior for booleans #22596

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
type Foo<T> = T extends any ? T[] : never

type Bar = Foo<string | number | boolean>

Expected

Bar has type string[] | number[] | boolean[]

Actual

Bar has type string[] | number[] | true[] | false[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions