-
Notifications
You must be signed in to change notification settings - Fork 12.8k
preserveConstEnums does not preserve const enums from ambient declarations #1934
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
Comments
Sorry, I should have mentioned duplicate of : #1812 |
Is it? That one seems like the opposite issue. Well, in any case. Here’s another test case! |
I am not clear either (I only know of inconsistency in the defaults used by language service vs. command line |
|
The language service is not inlining. That is we get |
Sorry, I guess I totally misunderstood the purpose of this flag. I thought it was intended to keep the enum references as well. I guess then …edit this ticket into a request to have an option to do that? Basically, at the moment, it’s impossible to create pre-compiled versions of portable libraries, since the enum values of a dependency might change across versions even though the enum keys are the same. (This happened in the TS language services from 1.4 to 1.5.) |
Exposing a The 'option' for always using property references for enum members is to not use const enums 😉 We shouldn't have broken a const enum value between versions. Which one changed specifically? |
SyntaxKind |
Ugh, of course, I don’t even… some days. |
Run:
tsc -m commonjs -t es5 --preserveConstEnums ambient.d.ts g.ts
Expected output of g.js:
Actual output of g.js:
Version: 1.4.1, 1.5.0-pre 9f49a16
The text was updated successfully, but these errors were encountered: