2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
|
|
|
|
module A {
|
2014-08-28 21:40:58 +02:00
|
|
|
>A : typeof A
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export interface Point {
|
|
|
|
>Point : Point
|
|
|
|
|
|
|
|
x: number;
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
y: number;
|
|
|
|
>y : number
|
|
|
|
}
|
|
|
|
|
|
|
|
export module Utils {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Utils : typeof Utils
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function mirror<T extends Point>(p: T) {
|
2014-08-28 21:52:44 +02:00
|
|
|
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
>Point : Point
|
|
|
|
>p : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
return { x: p.y, y: p.x };
|
|
|
|
>{ x: p.y, y: p.x } : { x: number; y: number; }
|
|
|
|
>x : number
|
|
|
|
>p.y : number
|
|
|
|
>p : T
|
|
|
|
>y : number
|
|
|
|
>y : number
|
|
|
|
>p.x : number
|
|
|
|
>p : T
|
|
|
|
>x : number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export var Origin: Point = { x: 0, y: 0 };
|
|
|
|
>Origin : Point
|
|
|
|
>Point : Point
|
|
|
|
>{ x: 0, y: 0 } : { x: number; y: number; }
|
|
|
|
>x : number
|
|
|
|
>y : number
|
|
|
|
}
|
|
|
|
|
|
|
|
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
|
|
|
|
module A {
|
2014-08-28 21:40:58 +02:00
|
|
|
>A : typeof A
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// not a collision, since we don't export
|
|
|
|
var Origin: string = "0,0";
|
|
|
|
>Origin : string
|
|
|
|
|
|
|
|
export module Utils {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Utils : typeof Utils
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export class Plane {
|
|
|
|
>Plane : Plane
|
|
|
|
|
|
|
|
constructor(public tl: Point, public br: Point) { }
|
|
|
|
>tl : Point
|
|
|
|
>Point : Point
|
|
|
|
>br : Point
|
|
|
|
>Point : Point
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
=== tests/cases/conformance/internalModules/DeclarationMerging/part3.ts ===
|
|
|
|
// test the merging actually worked
|
|
|
|
|
|
|
|
var o: { x: number; y: number };
|
|
|
|
>o : { x: number; y: number; }
|
|
|
|
>x : number
|
|
|
|
>y : number
|
|
|
|
|
|
|
|
var o: A.Point;
|
|
|
|
>o : { x: number; y: number; }
|
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 o = A.Origin;
|
|
|
|
>o : { x: number; y: number; }
|
2014-08-25 19:36:12 +02:00
|
|
|
>A.Origin : A.Point
|
2014-08-15 23:33:16 +02:00
|
|
|
>A : typeof A
|
2014-08-25 19:36:12 +02:00
|
|
|
>Origin : A.Point
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var o = A.Utils.mirror(o);
|
|
|
|
>o : { x: number; y: number; }
|
|
|
|
>A.Utils.mirror(o) : { x: number; y: number; }
|
2014-08-28 21:52:44 +02:00
|
|
|
>A.Utils.mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
2014-08-25 19:36:12 +02:00
|
|
|
>A.Utils : typeof A.Utils
|
2014-08-15 23:33:16 +02:00
|
|
|
>A : typeof A
|
2014-08-25 19:36:12 +02:00
|
|
|
>Utils : typeof A.Utils
|
2014-08-28 21:52:44 +02:00
|
|
|
>mirror : <T extends A.Point>(p: T) => { x: number; y: number; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>o : { x: number; y: number; }
|
|
|
|
|
|
|
|
var p: { tl: A.Point; br: A.Point };
|
2014-08-25 19:36:12 +02:00
|
|
|
>p : { tl: A.Point; br: A.Point; }
|
|
|
|
>tl : A.Point
|
2014-08-28 21:40:58 +02:00
|
|
|
>A : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>Point : A.Point
|
|
|
|
>br : 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: A.Utils.Plane;
|
2014-08-25 19:36:12 +02:00
|
|
|
>p : { tl: A.Point; br: A.Point; }
|
2014-08-28 21:40:58 +02:00
|
|
|
>A : unknown
|
|
|
|
>Utils : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>Plane : A.Utils.Plane
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
2014-08-25 19:36:12 +02:00
|
|
|
>p : { tl: A.Point; br: A.Point; }
|
|
|
|
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
|
|
|
|
>A.Utils.Plane : typeof A.Utils.Plane
|
|
|
|
>A.Utils : typeof A.Utils
|
2014-08-15 23:33:16 +02:00
|
|
|
>A : typeof A
|
2014-08-25 19:36:12 +02:00
|
|
|
>Utils : typeof A.Utils
|
|
|
|
>Plane : typeof A.Utils.Plane
|
2014-08-15 23:33:16 +02:00
|
|
|
>o : { x: number; y: number; }
|
|
|
|
>{ x: 1, y: 1 } : { x: number; y: number; }
|
|
|
|
>x : number
|
|
|
|
>y : number
|
|
|
|
|
|
|
|
|