title: Instantiate a class of type abstract class
body: <p>The function createBob has a TS error because Person is an abstract class and I can't instantiate it.
  I want the function to only accept the classes that extend Person and are not abstract.</p>
  <pre><code>abstract class Person {
      protected abstract type?: string
      constructor(private name: string) {}
  
      protected greet() {
          console.log(`Hello ${this.name}`)
      }
  }
  
  
  class Student extends Person {
      type = &quot;Student&quot; 
      constructor(type: string) {
          super(type)
      }
  }
  
  class Teacher extends Person {
      type = &quot;teacher&quot;
      constructor(type: string) {
          super(type)
      }
  }
  
  function createPerson(ClassThatInheritsPerson: typeof Person): Person {
      /*
      * The ClassThatInheritsPerson should only accept classes that extend Person but are not Person
      */
      return new ClassThatInheritsPerson()
  }
  
  const teacher1 = createPerson(Teacher) // should be allowed
  const student1 = createPerson(Student) // should be allowed
  const person = createPerson(Person) // shouldn't be allowed
  </code></pre>