Closed
Description
TypeScript Version: 2.9.1
Search Terms:
object type, generic, spread, error
Code
function test<T extends object>(a: T) {
return { ...a };
}
Expected behavior:
No error.
Actual behavior:
Error: Spread types may only be created from object types.
Playground Link:
Here you go.
Related Issues:
None found so far.
Metadata
Metadata
Assignees
Labels
No labels