Skip to content

fix: Correctly generate TSMappedType - #16394

Merged
nicolo-ribaudo merged 1 commit into
babel:mainfrom
liuxingbaoyu:fix-TSMappedType
Apr 1, 2024
Merged

nicolo-ribaudo merged 1 commit into
babel:mainfrom
liuxingbaoyu:fix-TSMappedType

Conversation

@liuxingbaoyu

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

@liuxingbaoyu
liuxingbaoyu requested a review from JLHwung April 1, 2024 11:12
@nicolo-ribaudo
nicolo-ribaudo merged commit 22725e9 into babel:main Apr 1, 2024
@aczekajski

aczekajski commented Apr 1, 2024 •

Copy link
Copy Markdown

@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
Copy Markdown
Member Author

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

@nicolo-ribaudo

Copy link
Copy Markdown
Member

Ugh, til that's valid TS 😬

@aczekajski

Copy link
Copy Markdown

Suprisingly it is 😂

@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 2, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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