TypeScript/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types
2014-08-15 14:37:48 -07:00

126 lines
2.5 KiB
Plaintext

=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
module A {
>A : typeof A
export interface Point {
>Point : Point
x: number;
>x : number
y: number;
>y : number
}
export module Utils {
>Utils : typeof Utils
export function mirror<T extends Point>(p: T) {
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
>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 {
>A : typeof A
// not a collision, since we don't export
var Origin: string = "0,0";
>Origin : string
export module Utils {
>Utils : typeof Utils
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; }
>A : A
>Point : Point
var o = A.Origin;
>o : { x: number; y: number; }
>A.Origin : Point
>A : typeof A
>Origin : Point
var o = A.Utils.mirror(o);
>o : { x: number; y: number; }
>A.Utils.mirror(o) : { x: number; y: number; }
>A.Utils.mirror : <T extends Point>(p: T) => { x: number; y: number; }
>A.Utils : typeof Utils
>A : typeof A
>Utils : typeof Utils
>mirror : <T extends Point>(p: T) => { x: number; y: number; }
>o : { x: number; y: number; }
var p: { tl: A.Point; br: A.Point };
>p : { tl: Point; br: Point; }
>tl : Point
>A : A
>Point : Point
>br : Point
>A : A
>Point : Point
var p: A.Utils.Plane;
>p : { tl: Point; br: Point; }
>A : A
>Utils : Utils
>Plane : Plane
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
>p : { tl: Point; br: Point; }
>new A.Utils.Plane(o, { x: 1, y: 1 }) : Plane
>A.Utils.Plane : typeof Plane
>A.Utils : typeof Utils
>A : typeof A
>Utils : typeof Utils
>Plane : typeof Plane
>o : { x: number; y: number; }
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>y : number