2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/typeResolution.ts ===
|
|
|
|
export module TopLevelModule1 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : typeof TopLevelModule1
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export module SubModule1 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule1 : typeof SubModule1
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export module SubSubModule1 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : typeof SubSubModule1
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export class ClassA {
|
|
|
|
>ClassA : ClassA
|
|
|
|
|
|
|
|
public AisIn1_1_1() {
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Try all qualified names of this type
|
|
|
|
var a1: ClassA; a1.AisIn1_1_1();
|
|
|
|
>a1 : ClassA
|
|
|
|
>ClassA : ClassA
|
|
|
|
>a1.AisIn1_1_1() : void
|
|
|
|
>a1.AisIn1_1_1 : () => void
|
|
|
|
>a1 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a2: SubSubModule1.ClassA; a2.AisIn1_1_1();
|
|
|
|
>a2 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a2.AisIn1_1_1() : void
|
|
|
|
>a2.AisIn1_1_1 : () => void
|
|
|
|
>a2 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1();
|
|
|
|
>a3 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a3.AisIn1_1_1() : void
|
|
|
|
>a3.AisIn1_1_1 : () => void
|
|
|
|
>a3 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1();
|
|
|
|
>a4 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a4.AisIn1_1_1() : void
|
|
|
|
>a4.AisIn1_1_1 : () => void
|
|
|
|
>a4 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Two variants of qualifying a peer type
|
|
|
|
var b1: ClassB; b1.BisIn1_1_1();
|
|
|
|
>b1 : ClassB
|
|
|
|
>ClassB : ClassB
|
|
|
|
>b1.BisIn1_1_1() : void
|
|
|
|
>b1.BisIn1_1_1 : () => void
|
|
|
|
>b1 : ClassB
|
|
|
|
>BisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var b2: TopLevelModule1.SubModule1.SubSubModule1.ClassB; b2.BisIn1_1_1();
|
|
|
|
>b2 : ClassB
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassB : ClassB
|
|
|
|
>b2.BisIn1_1_1() : void
|
|
|
|
>b2.BisIn1_1_1 : () => void
|
|
|
|
>b2 : ClassB
|
|
|
|
>BisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Type only accessible from the root
|
|
|
|
var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule2 : unknown
|
|
|
|
>SubSubModule2 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>c1.AisIn1_2_2() : void
|
|
|
|
>c1.AisIn1_2_2 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
// Interface reference
|
|
|
|
var d1: InterfaceX; d1.XisIn1_1_1();
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>d1.XisIn1_1_1() : any
|
|
|
|
>d1.XisIn1_1_1 : () => any
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
|
|
|
|
var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1();
|
|
|
|
>d2 : InterfaceX
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>d2.XisIn1_1_1() : any
|
|
|
|
>d2.XisIn1_1_1 : () => any
|
|
|
|
>d2 : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export class ClassB {
|
|
|
|
>ClassB : ClassB
|
|
|
|
|
|
|
|
public BisIn1_1_1() {
|
|
|
|
>BisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
/** Exactly the same as above in AisIn1_1_1 **/
|
|
|
|
|
|
|
|
// Try all qualified names of this type
|
|
|
|
var a1: ClassA; a1.AisIn1_1_1();
|
|
|
|
>a1 : ClassA
|
|
|
|
>ClassA : ClassA
|
|
|
|
>a1.AisIn1_1_1() : void
|
|
|
|
>a1.AisIn1_1_1 : () => void
|
|
|
|
>a1 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a2: SubSubModule1.ClassA; a2.AisIn1_1_1();
|
|
|
|
>a2 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a2.AisIn1_1_1() : void
|
|
|
|
>a2.AisIn1_1_1 : () => void
|
|
|
|
>a2 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1();
|
|
|
|
>a3 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a3.AisIn1_1_1() : void
|
|
|
|
>a3.AisIn1_1_1 : () => void
|
|
|
|
>a3 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1();
|
|
|
|
>a4 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a4.AisIn1_1_1() : void
|
|
|
|
>a4.AisIn1_1_1 : () => void
|
|
|
|
>a4 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Two variants of qualifying a peer type
|
|
|
|
var b1: ClassB; b1.BisIn1_1_1();
|
|
|
|
>b1 : ClassB
|
|
|
|
>ClassB : ClassB
|
|
|
|
>b1.BisIn1_1_1() : void
|
|
|
|
>b1.BisIn1_1_1 : () => void
|
|
|
|
>b1 : ClassB
|
|
|
|
>BisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var b2: TopLevelModule1.SubModule1.SubSubModule1.ClassB; b2.BisIn1_1_1();
|
|
|
|
>b2 : ClassB
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassB : ClassB
|
|
|
|
>b2.BisIn1_1_1() : void
|
|
|
|
>b2.BisIn1_1_1 : () => void
|
|
|
|
>b2 : ClassB
|
|
|
|
>BisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Type only accessible from the root
|
|
|
|
var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule2 : unknown
|
|
|
|
>SubSubModule2 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>c1.AisIn1_2_2() : void
|
|
|
|
>c1.AisIn1_2_2 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
var c2: TopLevelModule2.SubModule3.ClassA; c2.AisIn2_3();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c2 : TopLevelModule2.SubModule3.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule2 : unknown
|
|
|
|
>SubModule3 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : TopLevelModule2.SubModule3.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>c2.AisIn2_3() : void
|
|
|
|
>c2.AisIn2_3 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>c2 : TopLevelModule2.SubModule3.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn2_3 : () => void
|
|
|
|
|
|
|
|
// Interface reference
|
|
|
|
var d1: InterfaceX; d1.XisIn1_1_1();
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>d1.XisIn1_1_1() : any
|
|
|
|
>d1.XisIn1_1_1 : () => any
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
|
|
|
|
var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1();
|
|
|
|
>d2 : InterfaceX
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>d2.XisIn1_1_1() : any
|
|
|
|
>d2.XisIn1_1_1 : () => any
|
|
|
|
>d2 : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export interface InterfaceX { XisIn1_1_1(); }
|
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
|
|
|
|
class NonExportedClassQ {
|
|
|
|
>NonExportedClassQ : NonExportedClassQ
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
function QQ() {
|
|
|
|
>QQ : () => void
|
|
|
|
|
|
|
|
/* Sampling of stuff from AisIn1_1_1 */
|
|
|
|
var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1();
|
|
|
|
>a4 : ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-15 23:33:16 +02:00
|
|
|
>ClassA : ClassA
|
|
|
|
>a4.AisIn1_1_1() : void
|
|
|
|
>a4.AisIn1_1_1 : () => void
|
|
|
|
>a4 : ClassA
|
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule2 : unknown
|
|
|
|
>SubSubModule2 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>c1.AisIn1_2_2() : void
|
|
|
|
>c1.AisIn1_2_2 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>c1 : SubModule2.SubSubModule2.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
var d1: InterfaceX; d1.XisIn1_1_1();
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>InterfaceX : InterfaceX
|
|
|
|
>d1.XisIn1_1_1() : any
|
|
|
|
>d1.XisIn1_1_1 : () => any
|
|
|
|
>d1 : InterfaceX
|
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
|
|
|
|
var c2: TopLevelModule2.SubModule3.ClassA; c2.AisIn2_3();
|
2014-08-25 19:36:12 +02:00
|
|
|
>c2 : TopLevelModule2.SubModule3.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule2 : unknown
|
|
|
|
>SubModule3 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : TopLevelModule2.SubModule3.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>c2.AisIn2_3() : void
|
|
|
|
>c2.AisIn2_3 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>c2 : TopLevelModule2.SubModule3.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn2_3 : () => void
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Should have no effect on S1.SS1.ClassA above because it is not exported
|
|
|
|
class ClassA {
|
|
|
|
>ClassA : ClassA
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
function AA() {
|
|
|
|
>AA : () => void
|
|
|
|
|
|
|
|
var a2: SubSubModule1.ClassA; a2.AisIn1_1_1();
|
2014-08-25 19:36:12 +02:00
|
|
|
>a2 : SubSubModule1.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>a2.AisIn1_1_1() : void
|
|
|
|
>a2.AisIn1_1_1 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>a2 : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1();
|
2014-08-25 19:36:12 +02:00
|
|
|
>a3 : SubSubModule1.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>a3.AisIn1_1_1() : void
|
|
|
|
>a3.AisIn1_1_1 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>a3 : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1();
|
2014-08-25 19:36:12 +02:00
|
|
|
>a4 : SubSubModule1.ClassA
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule1 : unknown
|
|
|
|
>SubModule1 : unknown
|
|
|
|
>SubSubModule1 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>ClassA : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>a4.AisIn1_1_1() : void
|
|
|
|
>a4.AisIn1_1_1 : () => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>a4 : SubSubModule1.ClassA
|
2014-08-15 23:33:16 +02:00
|
|
|
>AisIn1_1_1 : () => void
|
|
|
|
|
|
|
|
// Interface reference
|
|
|
|
var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1();
|
2014-08-25 19:36:12 +02:00
|
|
|
>d2 : SubSubModule1.InterfaceX
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule1 : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>InterfaceX : SubSubModule1.InterfaceX
|
2014-08-15 23:33:16 +02:00
|
|
|
>d2.XisIn1_1_1() : any
|
|
|
|
>d2.XisIn1_1_1 : () => any
|
2014-08-25 19:36:12 +02:00
|
|
|
>d2 : SubSubModule1.InterfaceX
|
2014-08-15 23:33:16 +02:00
|
|
|
>XisIn1_1_1 : () => any
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export module SubModule2 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule2 : typeof SubModule2
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export module SubSubModule2 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubSubModule2 : typeof SubSubModule2
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// No code here since these are the mirror of the above calls
|
|
|
|
export class ClassA { public AisIn1_2_2() { } }
|
|
|
|
>ClassA : ClassA
|
|
|
|
>AisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
export class ClassB { public BisIn1_2_2() { } }
|
|
|
|
>ClassB : ClassB
|
|
|
|
>BisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
export class ClassC { public CisIn1_2_2() { } }
|
|
|
|
>ClassC : ClassC
|
|
|
|
>CisIn1_2_2 : () => void
|
|
|
|
|
|
|
|
export interface InterfaceY { YisIn1_2_2(); }
|
|
|
|
>InterfaceY : InterfaceY
|
|
|
|
>YisIn1_2_2 : () => any
|
|
|
|
|
|
|
|
interface NonExportedInterfaceQ { }
|
|
|
|
>NonExportedInterfaceQ : NonExportedInterfaceQ
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface InterfaceY { YisIn1_2(); }
|
|
|
|
>InterfaceY : InterfaceY
|
|
|
|
>YisIn1_2 : () => any
|
|
|
|
}
|
|
|
|
|
|
|
|
class ClassA {
|
|
|
|
>ClassA : ClassA
|
|
|
|
|
|
|
|
public AisIn1() { }
|
|
|
|
>AisIn1 : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
interface InterfaceY {
|
|
|
|
>InterfaceY : InterfaceY
|
|
|
|
|
|
|
|
YisIn1();
|
|
|
|
>YisIn1 : () => any
|
|
|
|
}
|
|
|
|
|
|
|
|
module NotExportedModule {
|
2014-08-28 21:40:58 +02:00
|
|
|
>NotExportedModule : typeof NotExportedModule
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export class ClassA { }
|
|
|
|
>ClassA : ClassA
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module TopLevelModule2 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>TopLevelModule2 : typeof TopLevelModule2
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export module SubModule3 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>SubModule3 : typeof SubModule3
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export class ClassA {
|
|
|
|
>ClassA : ClassA
|
|
|
|
|
|
|
|
public AisIn2_3() { }
|
|
|
|
>AisIn2_3 : () => void
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|