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
|
=== tests/cases/conformance/internalModules/codeGeneration/importStatements.ts ===
module A {
>A : typeof A
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
}
export var Origin = new Point(0, 0);
>Origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
>0 : 0
>0 : 0
}
// no code gen expected
module B {
import a = A; //Error generates 'var <Alias> = <EntityName>;'
>a : typeof a
>A : typeof a
}
// no code gen expected
module C {
>C : typeof C
import a = A; //Error generates 'var <Alias> = <EntityName>;'
>a : typeof a
>A : typeof a
var m: typeof a;
>m : typeof a
>a : typeof a
var p: a.Point;
>p : a.Point
>a : any
var p = {x:0, y:0 };
>p : a.Point
>{x:0, y:0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
// code gen expected
module D {
>D : typeof D
import a = A;
>a : typeof a
>A : typeof a
var p = new a.Point(1, 1);
>p : a.Point
>new a.Point(1, 1) : a.Point
>a.Point : typeof a.Point
>a : typeof a
>Point : typeof a.Point
>1 : 1
>1 : 1
}
module E {
>E : typeof E
import a = A;
>a : typeof a
>A : typeof a
export function xDist(x: a.Point) {
>xDist : (x: a.Point) => number
>x : a.Point
>a : any
return (a.Origin.x - x.x);
>(a.Origin.x - x.x) : number
>a.Origin.x - x.x : number
>a.Origin.x : number
>a.Origin : a.Point
>a : typeof a
>Origin : a.Point
>x : number
>x.x : number
>x : a.Point
>x : number
}
}
|