TypeScript/tests/baselines/reference/importStatements.types

94 lines
1.6 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/internalModules/codeGeneration/importStatements.ts ===
module A {
2014-08-28 21:40:58 +02:00
>A : typeof A
2014-08-15 23:33:16 +02:00
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
}
// no code gen expected
module B {
2014-08-28 21:40:58 +02:00
>B : unknown
2014-08-15 23:33:16 +02:00
import a = A; //Error generates 'var <Alias> = <EntityName>;'
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
}
// no code gen expected
module C {
2014-08-28 21:40:58 +02:00
>C : typeof C
2014-08-15 23:33:16 +02:00
import a = A; //Error generates 'var <Alias> = <EntityName>;'
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
var m: typeof a;
2014-08-25 19:36:12 +02:00
>m : typeof a
>a : typeof a
2014-08-15 23:33:16 +02:00
var p: a.Point;
2014-08-25 19:36:12 +02:00
>p : a.Point
2014-08-28 21:40:58 +02:00
>a : unknown
2014-08-25 19:36:12 +02:00
>Point : a.Point
2014-08-15 23:33:16 +02:00
var p = {x:0, y:0 };
2014-08-25 19:36:12 +02:00
>p : a.Point
2014-08-15 23:33:16 +02:00
>{x:0, y:0 } : { x: number; y: number; }
>x : number
>y : number
}
// code gen expected
module D {
2014-08-28 21:40:58 +02:00
>D : typeof D
2014-08-15 23:33:16 +02:00
import a = A;
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
var p = new a.Point(1, 1);
2014-08-25 19:36:12 +02:00
>p : a.Point
>new a.Point(1, 1) : a.Point
>a.Point : typeof a.Point
>a : typeof a
>Point : typeof a.Point
2014-08-15 23:33:16 +02:00
}
module E {
2014-08-28 21:40:58 +02:00
>E : typeof E
2014-08-15 23:33:16 +02:00
import a = A;
2014-08-28 21:40:58 +02:00
>a : typeof a
2014-08-25 19:36:12 +02:00
>A : typeof a
2014-08-15 23:33:16 +02:00
export function xDist(x: a.Point) {
>xDist : (x: a.Point) => number
2014-08-25 19:36:12 +02:00
>x : a.Point
2014-08-28 21:40:58 +02:00
>a : unknown
2014-08-25 19:36:12 +02:00
>Point : a.Point
2014-08-15 23:33:16 +02:00
return (a.Origin.x - x.x);
>(a.Origin.x - x.x) : number
>a.Origin.x - x.x : number
>a.Origin.x : number
2014-08-25 19:36:12 +02:00
>a.Origin : a.Point
>a : typeof a
>Origin : a.Point
2014-08-15 23:33:16 +02:00
>x : number
>x.x : number
2014-08-25 19:36:12 +02:00
>x : a.Point
2014-08-15 23:33:16 +02:00
>x : number
}
}