TypeScript Version: 2.9.1
Search Terms:
object type, generic, spread, error
Code
functiontest<Textendsobject>(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.
TypeScript Version: 2.9.1
Search Terms:
object type, generic, spread, error
Code
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.