-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Regression: bug in emitted declarations involving branded types since 5.1 #54655
Comments
I'm confused as to why there are type annotations in "compiled" code, in any TS version. Even your Playground shows that the compiled JS code is: export const toBoundedInteger = (bounds) => (n) =>
// Implementation doesn't matter here
({}); |
@fatcerberus in the playground, you can see the definitions in the Those definitions are exported in the emitted code so that TS code that imports from this compiled code (e.g. when this is a library) can have the proper types. So for instance, I could emit the |
Ah, you meant the |
@fatcerberus good point, I've updated the issue description to hopefully clarify that, thanks for the feedback 🙏 |
Any news on this topic? The fix seems has been available since June, anything I can help with to help get it merged? |
Using the original playground link, it looks like this bug is fixed in nightly. I bisected and figured out that I fixed it in #55820... 😅 I'll send a PR to add a test. |
Bug Report
Code that used to compile fine in 5.0.0 now produces invalid declarations with type names suffixed in
_1
which are not defined (see code below).🔎 Search Terms
Branded type, suffix, emit
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
🙂 Expected behavior
The text was updated successfully, but these errors were encountered: