title: Generic type array of objects in typescript
body: <p>Give then following:</p>
  
  <pre><code>interface Datum {
      [k: string]: any
  }
  
  type Data = Datum[]
  
  const inner = (data: Data) =&gt; {
      console.log(data)
  };
  
  
  const outer = (data: Data | Data[]) =&gt; {
      inner(data) // expect type error?
  };
  
  </code></pre>
  
  <p>I dont understand how I dont get a <code>type error</code> on the <code>inner function call</code>. I guess it has something to do with the <code>generic</code>. Cant figure out a way of rewriting. </p>