Skip to content

Unions and intersections of type predicates produce wrong type #17757

Closed
@SamPruden

Description

@SamPruden

TypeScript Version: 2.5.0-dev.20170803

Code

type Foo = typeof ts.isDoStatement | typeof ts.isWhileStatement;

Expected behavior:
Resulting type should be (node: ts.Node) => node is (ts.DoStatement | ts.WhileStatement)

Actual behavior:
Resulting type is (node: ts.Node) => node is ts.DoStatement

It seems to just take the first one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions