declarationFiles.ts(2,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(3,24): error TS2322: Type 'undefined' is not assignable to type 'this'.
  'this' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.
declarationFiles.ts(4,20): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
declarationFiles.ts(17,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(18,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(19,5): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(20,5): error TS2564: Property 'd' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(21,5): error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(22,5): error TS2564: Property 'f' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(23,5): error TS2564: Property 'g' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(24,5): error TS2564: Property 'h' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(25,5): error TS2564: Property 'i' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(26,5): error TS2564: Property 'j' has no initializer and is not definitely assigned in the constructor.
declarationFiles.ts(30,5): error TS2527: The inferred type of 'x1' references an inaccessible 'this' type. A type annotation is necessary.
declarationFiles.ts(32,5): error TS2527: The inferred type of 'x3' references an inaccessible 'this' type. A type annotation is necessary.
declarationFiles.ts(34,5): error TS2527: The inferred type of 'f1' references an inaccessible 'this' type. A type annotation is necessary.
declarationFiles.ts(40,5): error TS2527: The inferred type of 'f3' references an inaccessible 'this' type. A type annotation is necessary.


==== declarationFiles.ts (17 errors) ====
    class C1 {
        x: this;
        ~
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
        f(x: this): this { return undefined; }
                           ~~~~~~
!!! error TS2322: Type 'undefined' is not assignable to type 'this'.
!!! error TS2322:   'this' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.
        constructor(x: this) { }
                       ~~~~
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
    }
    
    class C2 {
        [x: string]: this;
    }
    
    interface Foo<T> {
        x: T;
        y: this;
    }
    
    class C3 {
        a: this[];
        ~
!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
        b: [this, this];
        ~
!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor.
        c: this | Date;
        ~
!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor.
        d: this & Date;
        ~
!!! error TS2564: Property 'd' has no initializer and is not definitely assigned in the constructor.
        e: (((this)));
        ~
!!! error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor.
        f: (x: this) => this;
        ~
!!! error TS2564: Property 'f' has no initializer and is not definitely assigned in the constructor.
        g: new (x: this) => this;
        ~
!!! error TS2564: Property 'g' has no initializer and is not definitely assigned in the constructor.
        h: Foo<this>;
        ~
!!! error TS2564: Property 'h' has no initializer and is not definitely assigned in the constructor.
        i: Foo<this | (() => this)>;
        ~
!!! error TS2564: Property 'i' has no initializer and is not definitely assigned in the constructor.
        j: (x: any) => x is this;
        ~
!!! error TS2564: Property 'j' has no initializer and is not definitely assigned in the constructor.
    }
    
    class C4 {
        x1 = { a: this };
        ~~
!!! error TS2527: The inferred type of 'x1' references an inaccessible 'this' type. A type annotation is necessary.
        x2 = [this];
        x3 = [{ a: this }];
        ~~
!!! error TS2527: The inferred type of 'x3' references an inaccessible 'this' type. A type annotation is necessary.
        x4 = () => this;
        f1() {
        ~~
!!! error TS2527: The inferred type of 'f1' references an inaccessible 'this' type. A type annotation is necessary.
            return { a: this };
        }
        f2() {
            return [this];
        }
        f3() {
        ~~
!!! error TS2527: The inferred type of 'f3' references an inaccessible 'this' type. A type annotation is necessary.
            return [{ a: this }];
        }
        f4() {
            return () => this;
        }
    }
    