emitClassExpressionInDeclarationFile.ts(5,12): error TS5088: The inferred type of 'circularReference' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary.


==== emitClassExpressionInDeclarationFile.ts (1 errors) ====
    export var simpleExample = class {
        static getTags() { }
        tags() { }
    }
    export var circularReference = class C {
               ~~~~~~~~~~~~~~~~~
!!! error TS5088: The inferred type of 'circularReference' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary.
        static getTags(c: C): C { return c }
        tags(c: C): C { return c }
    }
    
    // repro from #15066
    export class FooItem {
        foo(): void { }
        name?: string;
    }
    
    export type Constructor<T> = new(...args: any[]) => T;
    export function WithTags<T extends Constructor<FooItem>>(Base: T) {
        return class extends Base {
            static getTags(): void { }
            tags(): void { }
        }
    }
    
    export class Test extends WithTags(FooItem) {}
    
    const test = new Test();
    
    Test.getTags()
    test.tags();
    