Skip to content

ReferenceError caused by const enum #55212

Open
@magic-akari

Description

@magic-akari

Bug Report

🔎 Search Terms

  • const enum

🕗 Version & Regression Information

  • This is a runtime crash
  • This changed between versions 4.4.4 and 4.3.5
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _________

⏯ Playground Link

Playground link with relevant code

💻 Code

const enum Foo {
    a = 1,
}

console.log(Foo["1"])

🙁 Actual behavior

console.log(Foo["1"]);

🙂 Expected behavior

console.log("a");

or report error.

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