Repository navigation
Make ModuleResolutionKind.Node10 change backward-compatible - #53139
Andrew Branch (andrewbranch) merged 2 commits into
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 (@typescript-bot) cherry-pick to release-5.0 |
|
Heya Andrew Branch (@andrewbranch), I've started to run the task to cherry-pick this into |
|
Oh, phew. This reminds me that |
|
Hey Andrew Branch (@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