title: Instantiating Generic Types
body: <p>Given the following class:</p>
  
  <pre><code>class Datum {}
  </code></pre>
  
  <p>I get an error message (<code>error TS2304: Cannot find name 'T'</code>) when I try to do the following:</p>
  
  <pre><code>class Data&lt;T extends Datum&gt; {
      datum: T
  
      constructor() {
          this.datum = new T()
      }
  }
  </code></pre>
  
  <p>So then I try doing this, but I also get an error message (<code>Type 'Datum' is not assignable to type 'T'</code>):</p>
  
  <pre><code> class Data&lt;T extends Datum&gt; {
      datum: T
  
      constructor() {
          this.datum = new Datum();
      }
  }
  </code></pre>
  
  <p><strong>Question:</strong> Is it not possible to instantiate the constrained type T?  My assumption was that since T is constrained such that it must extend <code>Datum</code>, I'd be able to do <code>datum: T = new Datum()</code>.</p>