title: Typescript Class Constraint String
body: <p>I try to create a class with a string contraint but the it gives an error at the get scale() function.</p>
  <pre><code>class Scaling&lt;T extends string&gt; {
    _scale = &quot;&quot;;
  
    constructor(props: T) {
      this._scale = props;
    }
  
    setScale(scale: T) {
      this._scale = scale;
    }
  
    get scale(): T {
      return this._scale;
    }
  </code></pre>
  <blockquote>
  <p>Type 'string' is not assignable to type 'T'.   'string' is assignable
  to the constraint of type 'T', but 'T' could be instantiated with a
  different subtype of constraint 'string'.
  }</p>
  </blockquote>