-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Mapped Type bug with modifiers #13724
Comments
|
May I ask what exactly is the bug? If it should keep the |
I guess it's supposed to work like it does without parenthesis, but I was more looking for consistency here. Unfortunately, that workaround also removes the optional attribute, and it can't be declared to work recursively :( |
Bump. I just ran into this. Will this bug be getting a milestone? |
this is working as intended, it was meant as a way to allow for removal of |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Putting parenthesis around the "keyof T" syntax in an inline Mapped Type, strips out the field modifier (readonly).
Without parenthesis, or defining a template using the parenthesis, this doesn't happen.
TypeScript Version: 2.1.1
Code
Expected behavior:
MyType2, MyType3, and MyType4 to all have the same signature.
Actual behavior:
MyType2 and MyType4 keeps the original MyType signature with modifiers.
MyType3 strips out the modifiers:
The text was updated successfully, but these errors were encountered: