Skip to content
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

fix: Correctly generate TSMappedType #16394

Merged
merged 1 commit into from Apr 1, 2024

Conversation

liuxingbaoyu
Copy link
Member

Q                       A
Fixed Issues? Fixes #16393
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass?
Documentation PR Link
Any Dependency Changes?
License MIT

@liuxingbaoyu liuxingbaoyu added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: typescript pkg: generator labels Mar 29, 2024
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56592

@nicolo-ribaudo nicolo-ribaudo merged commit 22725e9 into babel:main Apr 1, 2024
51 checks passed
@aczekajski
Copy link

aczekajski commented Apr 1, 2024

@liuxingbaoyu Thank you for the swift fix!
I looked briefly at the PR and I have a feeling that it won't generate the same TS code in these cases:

type Foo2 = { [key in Bar]? };
type Foo3 = { [key in keyof Bar]-? };
type Foo4 = { [key in keyof Bar]+? };

@liuxingbaoyu
Copy link
Member Author

You are right, thank you! I will open a new PR.

@nicolo-ribaudo
Copy link
Member

Ugh, til that's valid TS 😬

@aczekajski
Copy link

Suprisingly it is 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: typescript pkg: generator PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Typescript mapped type with implicit any results in faulty TS
5 participants