Skip to content

Incorrect error message for use-before-declaration on const enum in preserveConstEnums #38722

Closed

Description

// @preserveConstEnums: true
E.A;

const enum E { A }

Expected:

Enum 'E' used before its declaration

Actual:

Class 'E' used before its declaration

Activity

  1. DanielRosenwasser commented on May 22, 2020

    @DanielRosenwasser
    MemberAuthor

    No new tests necessary, should already be covered by tests/cases/compiler/blockScopedEnumVariablesUseBeforeDef_preserve.ts.

  2. DanielRosenwasser commented on May 26, 2020

    @DanielRosenwasser
    MemberAuthor
  3. locked as resolved and limited conversation to collaborators on Oct 21, 2025
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

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions