title: Error casting a generic type to a concrete one
body: <p>I have the following TypeScript function:</p>
  
  <pre><code>add(element: T) {
   if (element instanceof class1) (&lt;class1&gt;element).owner = 100;
  }
  </code></pre>
  
  <p>the problem is that I'm getting the following error:</p>
  
  <blockquote>
    <p>error TS2012: Cannot convert 'T' to 'class1'</p>
  </blockquote>
  
  <p>Any ideas?</p>