Skip to content

Conditional types don't work with passed never type #23022

Closed
@falsandtru

Description

@falsandtru

cc @ahejlsberg

TypeScript Version: 2.7.0-dev.20180330

Search Terms:

Code

type C<T, U> = T extends U ? true : false;
type A = never extends void ? true : false;
type B = C<never, void>;

Expected behavior:

A and B are true.

Actual behavior:

A is true, B is never.

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    CanonicalThis issue contains a lengthy and complete description of a particular problem, solution, or designWorking as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions