2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/moduleVisibilityTest1.ts ===
|
|
|
|
|
|
|
|
|
|
|
|
module OuterMod {
|
2014-08-28 21:40:58 +02:00
|
|
|
>OuterMod : typeof OuterMod
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function someExportedOuterFunc() { return -1; }
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedOuterFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
>-1 : number
|
|
|
|
|
|
|
|
export module OuterInnerMod {
|
2014-08-28 21:40:58 +02:00
|
|
|
>OuterInnerMod : typeof OuterInnerMod
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function someExportedOuterInnerFunc() { return "foo"; }
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedOuterInnerFunc : () => string
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import OuterInnerAlias = OuterMod.OuterInnerMod;
|
2014-08-28 21:40:58 +02:00
|
|
|
>OuterInnerAlias : typeof OuterInnerAlias
|
2014-08-19 04:56:03 +02:00
|
|
|
>OuterMod : typeof OuterMod
|
2014-08-25 19:36:12 +02:00
|
|
|
>OuterInnerMod : typeof OuterInnerAlias
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
module M {
|
2014-08-28 21:40:58 +02:00
|
|
|
>M : typeof M
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export module InnerMod {
|
2014-08-28 21:40:58 +02:00
|
|
|
>InnerMod : typeof InnerMod
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function someExportedInnerFunc() { return -2; }
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedInnerFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
>-2 : number
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum E {
|
|
|
|
>E : E
|
|
|
|
|
|
|
|
A,
|
|
|
|
>A : E
|
|
|
|
|
|
|
|
B,
|
|
|
|
>B : E
|
|
|
|
|
|
|
|
C,
|
|
|
|
>C : E
|
|
|
|
}
|
|
|
|
|
|
|
|
export var x = 5;
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
export declare var exported_var;
|
|
|
|
>exported_var : any
|
|
|
|
|
|
|
|
var y = x + x;
|
|
|
|
>y : number
|
|
|
|
>x + x : number
|
|
|
|
>x : number
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
|
|
|
|
export interface I {
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
someMethod():number;
|
|
|
|
>someMethod : () => number
|
|
|
|
}
|
|
|
|
|
|
|
|
class B {public b = 0;}
|
|
|
|
>B : B
|
|
|
|
>b : number
|
|
|
|
|
|
|
|
export class C implements I {
|
|
|
|
>C : C
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();}
|
|
|
|
>someMethodThatCallsAnOuterMethod : () => string
|
|
|
|
>OuterInnerAlias.someExportedOuterInnerFunc() : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>OuterInnerAlias.someExportedOuterInnerFunc : () => string
|
2014-08-25 19:36:12 +02:00
|
|
|
>OuterInnerAlias : typeof OuterInnerAlias
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedOuterInnerFunc : () => string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();}
|
|
|
|
>someMethodThatCallsAnInnerMethod : () => number
|
|
|
|
>InnerMod.someExportedInnerFunc() : number
|
2014-08-28 21:52:44 +02:00
|
|
|
>InnerMod.someExportedInnerFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
>InnerMod : typeof InnerMod
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedInnerFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();}
|
|
|
|
>someMethodThatCallsAnOuterInnerMethod : () => number
|
|
|
|
>OuterMod.someExportedOuterFunc() : number
|
2014-08-28 21:52:44 +02:00
|
|
|
>OuterMod.someExportedOuterFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
>OuterMod : typeof OuterMod
|
2014-08-28 21:52:44 +02:00
|
|
|
>someExportedOuterFunc : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public someMethod() { return 0; }
|
|
|
|
>someMethod : () => number
|
|
|
|
|
|
|
|
public someProp = 1;
|
|
|
|
>someProp : number
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
function someInnerFunc() { return 2; }
|
|
|
|
>someInnerFunc : () => number
|
|
|
|
|
|
|
|
var someInnerVar = 3;
|
|
|
|
>someInnerVar : number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var someModuleVar = 4;
|
|
|
|
>someModuleVar : number
|
|
|
|
|
|
|
|
function someModuleFunction() { return 5;}
|
2014-08-28 21:52:44 +02:00
|
|
|
>someModuleFunction : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
2014-08-28 21:40:58 +02:00
|
|
|
>M : typeof M
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export var c = x;
|
|
|
|
>c : number
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
export var meb = M.E.B;
|
|
|
|
>meb : E
|
|
|
|
>M.E.B : E
|
|
|
|
>M.E : typeof E
|
|
|
|
>M : typeof M
|
|
|
|
>E : typeof E
|
|
|
|
>B : E
|
|
|
|
}
|
|
|
|
|
|
|
|
var cprime : M.I = <M.I>null;
|
2014-08-25 19:36:12 +02:00
|
|
|
>cprime : M.I
|
2014-08-28 21:40:58 +02:00
|
|
|
>M : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>I : M.I
|
|
|
|
><M.I>null : M.I
|
2014-08-28 21:40:58 +02:00
|
|
|
>M : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>I : M.I
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var c = new M.C();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c : M.C
|
|
|
|
>new M.C() : M.C
|
|
|
|
>M.C : typeof M.C
|
2014-08-15 23:33:16 +02:00
|
|
|
>M : typeof M
|
2014-08-25 19:36:12 +02:00
|
|
|
>C : typeof M.C
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var z = M.x;
|
|
|
|
>z : number
|
|
|
|
>M.x : number
|
|
|
|
>M : typeof M
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
var alpha = M.E.A;
|
2014-08-25 19:36:12 +02:00
|
|
|
>alpha : M.E
|
|
|
|
>M.E.A : M.E
|
|
|
|
>M.E : typeof M.E
|
2014-08-15 23:33:16 +02:00
|
|
|
>M : typeof M
|
2014-08-25 19:36:12 +02:00
|
|
|
>E : typeof M.E
|
|
|
|
>A : M.E
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var omega = M.exported_var;
|
|
|
|
>omega : any
|
|
|
|
>M.exported_var : any
|
|
|
|
>M : typeof M
|
|
|
|
>exported_var : any
|
|
|
|
|
|
|
|
c.someMethodThatCallsAnOuterMethod();
|
|
|
|
>c.someMethodThatCallsAnOuterMethod() : string
|
|
|
|
>c.someMethodThatCallsAnOuterMethod : () => string
|
2014-08-25 19:36:12 +02:00
|
|
|
>c : M.C
|
2014-08-15 23:33:16 +02:00
|
|
|
>someMethodThatCallsAnOuterMethod : () => string
|
|
|
|
|