Skip to content

Incorrect 'never' type inference in TypeScript 2.6 #20952

Closed
@sharwell

Description

@sharwell

TypeScript Version: 2.6.2

Code

https://github.com/sharwell/antlr4ts/blob/c9a8ef86fbdfc7f027916b5b281dac322495ca55/src/atn/LL1Analyzer.ts#L251

Expected behavior:

When the line is reached, t has the type Transition.

Actual behavior:

When the line is reached, t has the inferred type never. We are forced to work around the issue by explicitly casting and reassigning the variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions