Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError caused by const enum #55212

Open
magic-akari opened this issue Jul 31, 2023 · 2 comments · May be fixed by #55214
Open

ReferenceError caused by const enum #55212

magic-akari opened this issue Jul 31, 2023 · 2 comments · May be fixed by #55214
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@magic-akari
Copy link
Contributor

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.

@Andarist Andarist linked a pull request Jul 31, 2023 that will close this issue
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Jul 31, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jul 31, 2023
@vsviridov
Copy link

Also ran into the following situation:
image

@so1ve
Copy link

so1ve commented Aug 20, 2023

@vsviridov Your issue is #55421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants