mergeTwoInterfaces.ts(13,10): error TS2454: Variable 'a' is used before being assigned.
mergeTwoInterfaces.ts(14,10): error TS2454: Variable 'a' is used before being assigned.
mergeTwoInterfaces.ts(27,10): error TS2454: Variable 'b' is used before being assigned.
mergeTwoInterfaces.ts(28,10): error TS2454: Variable 'b' is used before being assigned.
mergeTwoInterfaces.ts(41,14): error TS2454: Variable 'a' is used before being assigned.
mergeTwoInterfaces.ts(43,14): error TS2454: Variable 'a' is used before being assigned.
mergeTwoInterfaces.ts(54,14): error TS2454: Variable 'b' is used before being assigned.
mergeTwoInterfaces.ts(56,14): error TS2454: Variable 'b' is used before being assigned.


==== mergeTwoInterfaces.ts (8 errors) ====
    // two interfaces with the same root module should merge
    
    // basic case
    interface A {
        foo: string;
    }
    
    interface A {
        bar: number;
    }
    
    var a: A;
    var r1 = a.foo
             ~
!!! error TS2454: Variable 'a' is used before being assigned.
    var r2 = a.bar;
             ~
!!! error TS2454: Variable 'a' is used before being assigned.
    
    // basic generic case
    interface B<T> {
        baz: string;
        foo: T;
    }
    
    interface B<T> {
        bar: T;
    }
    
    var b: B<string>;
    var r3 = b.foo
             ~
!!! error TS2454: Variable 'b' is used before being assigned.
    var r4 = b.bar;
             ~
!!! error TS2454: Variable 'b' is used before being assigned.
    
    // basic non-generic and generic case inside a module
    namespace M {
        interface A {
            foo: string;
        }
    
        interface A {
            bar: number;
        }
    
        var a: A;
        var r1 = a.foo;
                 ~
!!! error TS2454: Variable 'a' is used before being assigned.
        // BUG 856491
        var r2 = a.bar; // any, should be number
                 ~
!!! error TS2454: Variable 'a' is used before being assigned.
    
        interface B<T> {
            foo: T;
        }
    
        interface B<T> {
            bar: T;
        }
    
        var b: B<string>;
        var r3 = b.foo
                 ~
!!! error TS2454: Variable 'b' is used before being assigned.
        // BUG 856491
        var r4 = b.bar; // any, should be string
                 ~
!!! error TS2454: Variable 'b' is used before being assigned.
    }