title: Why using generic type be considered as using as value in generic class?
body: <p>Why compiler complains the following codes <code>T' only refers to a type, but is being used as a value here</code>:</p>
  <pre><code>class Factory&lt;T&gt; {
      create(TCreator: (new () =&gt; T)): T {
           return new TCreator();
      }
  
      test(json: string) {
          // compile error here:
          //          T' only refers to a type, but
          //          is being used as a value here
          let a: T = this.create(T);
  
          ...
      }
  }
  </code></pre>
  <p>I don't know.. Shouldn't <code>T</code> be a generic <code>type</code> in the class Factory? And can T be used as the argument of function &quot;create&quot; which has a parameter type as the same as T's constructor type.</p>
  <hr />
  <p>I think what I want to do is to create an instance of T in the class Factory. I have tried like <code>let a2: T = new T();</code> but ran into the same compile error.</p>