-
Notifications
You must be signed in to change notification settings - Fork 12.8k
ThisType is invalid when using object spread on generic object #52207
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
Comments
I'm not immediately convinced this one isn't fixable-in-principle. The non-spread case works and there isn't a circularity, so I don't see any blockers to it working. I guess the only problem is that properties from |
Hi, |
@RyanCavanaugh, I don't know at all how Typescript works internally. I can make a PR for this if needed but I'll need some guidance. |
It's very unlikely the fix here is approachable by someone not already quite familiar with the TypeScript codebase. It's definitely hard enough that I can't offer any concrete guidance on where to start. |
OK no problem. I'll wait for any update on this and notify this issue in my package for now. Thanks a lot for those explanation and triage. |
Bug Report
π Search Terms
ThisType Object Spread Generic
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The generic type is broken when the given object value contains a spread object.
π Expected behavior
The generic type should contain the spreaded object properties as those are finally included into the result object.
Comment
This may be related to #26412 and other issues like this one but I didn't found a workarround to get a ThisType correctly typed.
The text was updated successfully, but these errors were encountered: