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

TSX spread regression in 2.3 #15420

Closed
Igorbek opened this issue Apr 27, 2017 · 2 comments
Closed

TSX spread regression in 2.3 #15420

Igorbek opened this issue Apr 27, 2017 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@Igorbek
Copy link
Contributor

Igorbek commented Apr 27, 2017

TypeScript Version: 2.3.1

Code

import * as React from 'react';

function test<T extends object>(Component: React.StatelessComponent<T>, props: T) {
    return <Component {...props} />
                      ~~~~~~~~~~ error TS2698: Spread types may only be created from object types.
}

(same with React.ComponentClass)

Expected behavior:

Compile without an error.

Actual behavior:

Error: error TS2698: Spread types may only be created from object types.

That was already reported in closed issue #14112

@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2017

This is tracked by #10727 and fixed by #13288

@Igorbek
Copy link
Contributor Author

Igorbek commented Apr 27, 2017

Ah, ok, that is unfortunate that you didn't make it into 2.3. Closing as dup

@Igorbek Igorbek closed this as completed Apr 27, 2017
@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Apr 27, 2017
wms added a commit to fountainhead/basalplatten that referenced this issue May 5, 2017
2.3.x introduce a bug with spread types - waiting on
microsoft/TypeScript#15420
wms added a commit to fountainhead/basalplatten that referenced this issue May 5, 2017
2.3.x introduce a bug with spread types - waiting on
microsoft/TypeScript#15420
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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

3 participants