镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Incorrect 'never' type inference in TypeScript 2.6 #20952

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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