Typescript: Spread types may only be created from object types : <pre><code>function foo&lt;T extends object&gt;(t: T): T {

  return {
    ...t    // Error: [ts] Spread types may only be created from object types.
  }
}
</code></pre>

<p>I am aware that there are issues on github, but I can't figure out what is fixed and what is not and they have 2695 open issues. So I am posting here. I am using latest Typescript 2.9.2. </p>

<p>Should the above code not work? And how can I fix it if possible?</p>
