tests/cases/compiler/f3.ts(11,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
tests/cases/compiler/f3.ts(11,21): error TS2307: Cannot find module './f2'.
tests/cases/compiler/f3.ts(12,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
tests/cases/compiler/f3.ts(12,16): error TS4000: Import declaration 'I' is using private name 'N'.
tests/cases/compiler/f3.ts(13,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'C' is using private name 'N'.


==== tests/cases/compiler/f1.ts (0 errors) ====
    export class A {}
    
==== tests/cases/compiler/f2.ts (0 errors) ====
    export class B {
        n: number;
    }
    
==== tests/cases/compiler/f3.ts (6 errors) ====
    import {A} from "./f1";
    
    A.prototype.foo = function () { return undefined; }
    
    namespace N {
        export interface Ifc { a }
        export interface Cls { a }
    }
    
    declare module "./f1" {
        import {B} from "./f2";
        ~~~~~~
!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
                        ~~~~~~
!!! error TS2307: Cannot find module './f2'.
        import I = N.Ifc;
        ~~~~~~
!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
                   ~
!!! error TS4000: Import declaration 'I' is using private name 'N'.
        import C = N.Cls;
        ~~~~~~
!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.
                   ~
!!! error TS4000: Import declaration 'C' is using private name 'N'.
        interface A {
            foo(): B;
            bar(): I;
            baz(): C;
        }
    }
    
==== tests/cases/compiler/f4.ts (0 errors) ====
    import {A} from "./f1";
    import "./f3";
    
    let a: A;
    let b = a.foo().n;