-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Fix error when exporting const enums (#33060) #34721
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
Conversation
Actually, you do need exports.MyConstEnum = MyConstEnum; which is going to throw at runtime, as |
I don't see that as the behavior currently. It is correctly eliding the const enum export. |
Oh, hum. I guess if we're already eliding the export then it's not so bad. |
I'm happy to add another test case to explicitly test that const enums are not emitted on re-export without Also I'd really love this to go into 3.7 if everything looks good since this behavior is a regression from 3.5. |
A new test'd be great, yeah. |
Done. |
cc @RyanCavanaugh do we wanna do anything with this for 3.7? |
@typescript-bot cherry-pick this to |
Heya @DanielRosenwasser, I couldn't find the branch ' |
Ugh, come on, ignore the backticks you jerk robot. @typescript-bot cherry-pick this to release-3.7 and LKG |
Hey @DanielRosenwasser, I've opened #34811 for you. |
Const enums should be allowed to be exported using an export declaration. The fix is to remove an incorrect check that restricts exporting const enums in export declarations to work only when
--preserveConstEnums
is true.Fixes #33060