-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Make ModuleResolutionKind.Node10 change backward-compatible #53139
Make ModuleResolutionKind.Node10 change backward-compatible #53139
Conversation
That CI result is... weird. is this somehow non-deterministic? Maybe we have to make |
No, I just forgot to run tests with type checking after I swapped the order. |
@typescript-bot cherry-pick to release-5.0 |
Heya @andrewbranch, I've started to run the task to cherry-pick this into |
Oh, phew. This reminds me that |
Hey @andrewbranch, I've opened #53143 for you. |
The order has to be this way to make the enum reverse mapping point to the non-deprecated name, which appears in |
Yeah, I agree. Unfortunately in SyntaxKind's case, we must define old names in terms of new names (or vice versa) since the overall values are not stable (compared to this PR where we hardcoded "2"). But since it's vice versa, I can just send a PR that flips them around and it'll work. |
Although, I think the reason to pick the first one is due to cases like: enum NodeFlags {
Number = 1 << 1,
String = 1 << 2,
Something = Number | String, // What if String is removed?
} |
I’m not sure why you can’t forward reference since it gets inlined anyway https://www.typescriptlang.org/play?#code/KYOwrgtgBAolDeAoKKoEEoF4oEYA0yqAQluogL5A |
If you forward reference, you get an error:
Anyway, not super relevant to this PR besides |
Yeah, I meant I’m not sure why we issue that error in the first place. |
Yeah, though if you add a forward reference, the value it emits is... not right. |
…e-5.0 (#53143) Co-authored-by: Andrew Branch <andrew@wheream.io>
…to release-5.0 (microsoft#53143) Co-authored-by: Andrew Branch <andrew@wheream.io>
Fixes #53131