You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected "used before its declaration error" because the const enum is not inlined.
Or ... could TypeScript still inline the const enum since it's defined in the same file? I guess that might be too expensive?
Additional information about the issue
I profusely apologize. I think the behavior was changed due to #53019. I reported that the error should not happen if preserveConstEnums is enabled because the const enum is still inlined then. I didn't test isolatedModules then. I suspect the error was correct, it was just gated by the wrong flag.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
π Search Terms
isolatedModules, const enum, used before its declaration
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?isolatedModules=true&ts=5.1.6#code/FAYw9gdgzmA2CmA6WYDmAKAYmMiCCAlANzCiRQAuABPBAK4C2V2YVA3lXgDRUBCVAX2BA
π» Code
π Actual behavior
JS emit with
isolatedModules
is enabled:No error.
π Expected behavior
Expected "used before its declaration error" because the const enum is not inlined.
Or ... could TypeScript still inline the const enum since it's defined in the same file? I guess that might be too expensive?
Additional information about the issue
I profusely apologize. I think the behavior was changed due to #53019. I reported that the error should not happen if
preserveConstEnums
is enabled because the const enum is still inlined then. I didn't testisolatedModules
then. I suspect the error was correct, it was just gated by the wrong flag.The text was updated successfully, but these errors were encountered: