extendAndImplementTheSameBaseType2.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
extendAndImplementTheSameBaseType2.ts(4,9): error TS2322: Type 'null' is not assignable to type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
extendAndImplementTheSameBaseType2.ts(7,7): error TS2720: Class 'D' incorrectly implements class 'C<number>'. Did you mean to extend 'C<number>' and inherit its members as a subclass?
  The types returned by 'bar()' are incompatible between these types.
    Type 'string' is not assignable to type 'number'.
extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'.
extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'.


==== extendAndImplementTheSameBaseType2.ts (5 errors) ====
    class C<T> {
        foo: number
        ~~~
!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
        bar(): T {
            return null;
            ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'T'.
!!! error TS2322:   'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
        }
    }
    class D extends C<string> implements C<number> {
          ~
!!! error TS2720: Class 'D' incorrectly implements class 'C<number>'. Did you mean to extend 'C<number>' and inherit its members as a subclass?
!!! error TS2720:   The types returned by 'bar()' are incompatible between these types.
!!! error TS2720:     Type 'string' is not assignable to type 'number'.
        baz() { }
    }
    
    var d: D = new D();
    var r: string = d.foo;
        ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    var r2: number = d.foo;
    
    var r3: string = d.bar();
    var r4: number = d.bar();
        ~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.