cyclicTypeInstantiation.ts(6,12): error TS2454: Variable 'x' is used before being assigned.
cyclicTypeInstantiation.ts(14,12): error TS2454: Variable 'x' is used before being assigned.


==== cyclicTypeInstantiation.ts (2 errors) ====
    function foo<T>() {
        var x: {
            a: T;
            b: typeof x;
        };
        return x;
               ~
!!! error TS2454: Variable 'x' is used before being assigned.
    }
    
    function bar<T>() {
        var x: {
            a: T;
            b: typeof x;
        };
        return x;
               ~
!!! error TS2454: Variable 'x' is used before being assigned.
    }
    
    var a = foo<string>();
    var b = bar<string>();
    // Relating types of a and b produces instantiations of the cyclic anonymous types in foo and bar
    a = b;
    