We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 2.6.1
Code
function<T extends object>(it: T) { return { ...it }; }
Expected behavior: No error
Actual behavior: Error: Spread types may only be created from object types.
The text was updated successfully, but these errors were encountered:
T is a type parameter, which cannot be used to create a spread type. The object type constraint doesn't get around this rule.
T
object
If we ever add a first-class spread type this restriction will go away.
Sorry, something went wrong.
sandersn
No branches or pull requests
TypeScript Version: 2.6.1
Code
Expected behavior:
No error
Actual behavior:
Error: Spread types may only be created from object types.
The text was updated successfully, but these errors were encountered: