1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
=== tests/cases/conformance/externalModules/foo2.ts ===
import foo1 = require('./foo1');
>foo1 : typeof foo1
export module M1 {
>M1 : typeof M1
export class C1 {
>C1 : C1
m1: foo1.M1.C1;
>m1 : foo1.M1.C1
>foo1 : any
>M1 : any
y: number
>y : number
constructor(){
this.m1 = new foo1.M1.C1();
>this.m1 = new foo1.M1.C1() : foo1.M1.C1
>this.m1 : foo1.M1.C1
>this : this
>m1 : foo1.M1.C1
>new foo1.M1.C1() : foo1.M1.C1
>foo1.M1.C1 : typeof foo1.M1.C1
>foo1.M1 : typeof foo1.M1
>foo1 : typeof foo1
>M1 : typeof foo1.M1
>C1 : typeof foo1.M1.C1
this.m1.y = 10; // Error
>this.m1.y = 10 : 10
>this.m1.y : any
>this.m1 : foo1.M1.C1
>this : this
>m1 : foo1.M1.C1
>y : any
>10 : 10
this.m1.x = 20; // OK
>this.m1.x = 20 : 20
>this.m1.x : number
>this.m1 : foo1.M1.C1
>this : this
>m1 : foo1.M1.C1
>x : number
>20 : 20
var tmp = new M1.C1();
>tmp : C1
>new M1.C1() : C1
>M1.C1 : typeof C1
>M1 : typeof M1
>C1 : typeof C1
tmp.y = 10; // OK
>tmp.y = 10 : 10
>tmp.y : number
>tmp : C1
>y : number
>10 : 10
tmp.x = 20; // Error
>tmp.x = 20 : 20
>tmp.x : any
>tmp : C1
>x : any
>20 : 20
}
}
}
=== tests/cases/conformance/externalModules/foo1.ts ===
import foo2 = require('./foo2');
>foo2 : typeof foo2
export module M1 {
>M1 : typeof M1
export class C1 {
>C1 : C1
m1: foo2.M1.C1;
>m1 : foo2.M1.C1
>foo2 : any
>M1 : any
x: number;
>x : number
constructor(){
this.m1 = new foo2.M1.C1();
>this.m1 = new foo2.M1.C1() : foo2.M1.C1
>this.m1 : foo2.M1.C1
>this : this
>m1 : foo2.M1.C1
>new foo2.M1.C1() : foo2.M1.C1
>foo2.M1.C1 : typeof foo2.M1.C1
>foo2.M1 : typeof foo2.M1
>foo2 : typeof foo2
>M1 : typeof foo2.M1
>C1 : typeof foo2.M1.C1
this.m1.y = 10; // OK
>this.m1.y = 10 : 10
>this.m1.y : number
>this.m1 : foo2.M1.C1
>this : this
>m1 : foo2.M1.C1
>y : number
>10 : 10
this.m1.x = 20; // Error
>this.m1.x = 20 : 20
>this.m1.x : any
>this.m1 : foo2.M1.C1
>this : this
>m1 : foo2.M1.C1
>x : any
>20 : 20
}
}
}
|