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

Erroneous "Spread types may only be created from object types"? #22687

Closed
mindplay-dk opened this issue Mar 19, 2018 · 2 comments
Closed

Erroneous "Spread types may only be created from object types"? #22687

mindplay-dk opened this issue Mar 19, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@mindplay-dk
Copy link

I seem to be (incorrectly?) getting an error "Spread types may only be created from object types" for a case where the type in question is constrained as object.

Example here

When I hover over the offending call site:

image

The data property is of a type T where T extends object, so why am I not allowed to spread it's properties to a new object?

The code works as intended, I just can't seem to figure out what's required to get rid of the error message. I could just cast it as any of course, but that seems dirty?

@ajafff
Copy link
Contributor

ajafff commented Mar 19, 2018

Duplicate of #10727
Fix is proposed in #13288

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 19, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants