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

[BUG] Typescript enum compilation lost reference on version 0.18.9 #3210

Closed
noyobo opened this issue Jul 4, 2023 · 1 comment
Closed

[BUG] Typescript enum compilation lost reference on version 0.18.9 #3210

noyobo opened this issue Jul 4, 2023 · 1 comment

Comments

@noyobo
Copy link

noyobo commented Jul 4, 2023

import { MyEnum } from './enums';
enum MyEnum2 {
  'A.A' = 'a',
  'aa' = 'aa',
}
console.log(MyEnum['A.A'], MyEnum2['A.A']);
console.log(MyEnum.aa, MyEnum2['aa']);
console.log(MyEnum['aa'], MyEnum2.aa);

output:

// src/index.ts
console.log(MyEnum["A.A"], "a" /* A.A */);
console.log("aa" /* aa */, "aa" /* aa */);
console.log(MyEnum["aa"], "aa" /* aa */);

// error: MyEnum not defined

Conditions that trigger the bug:

  1. Import from other files
  2. Using string subscripts, like enum['key']
@noyobo noyobo changed the title [BUG] Typescript enum compilation lost reference on version 0.18.10 [BUG] Typescript enum compilation lost reference on version 0.18.9 Jul 4, 2023
@ghiscoding
Copy link

seems related to #3184

@evanw evanw closed this as completed in 33933c4 Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants