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

176 lines
2.6 KiB
Plaintext

=== tests/cases/conformance/internalModules/importDeclarations/exportImportAlias.ts ===
// expect no errors here
module A {
>A : typeof A
export var x = 'hello world'
>x : string
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
}
export module B {
>B : B
export interface Id {
>Id : Id
name: string;
>name : string
}
}
}
module C {
>C : typeof C
export import a = A;
>a : typeof A
>A : typeof A
}
var a: string = C.a.x;
>a : string
>C.a.x : string
>C.a : typeof A
>C : typeof C
>a : typeof A
>x : string
var b: { x: number; y: number; } = new C.a.Point(0, 0);
>b : { x: number; y: number; }
>x : number
>y : number
>new C.a.Point(0, 0) : Point
>C.a.Point : typeof Point
>C.a : typeof A
>C : typeof C
>a : typeof A
>Point : typeof Point
var c: { name: string };
>c : { name: string; }
>name : string
var c: C.a.B.Id;
>c : { name: string; }
>C : C
>a : a
>B : B
>Id : Id
module X {
>X : typeof X
export function Y() {
>Y : typeof Y
return 42;
}
export module Y {
>Y : typeof Y
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
}
}
}
module Z {
>Z : typeof Z
// 'y' should be a fundule here
export import y = X.Y;
>y : typeof Y
>X : typeof Y
>Y : typeof Y
}
var m: number = Z.y();
>m : number
>Z.y() : number
>Z.y : typeof Y
>Z : typeof Z
>y : typeof Y
var n: { x: number; y: number; } = new Z.y.Point(0, 0);
>n : { x: number; y: number; }
>x : number
>y : number
>new Z.y.Point(0, 0) : Point
>Z.y.Point : typeof Point
>Z.y : typeof Y
>Z : typeof Z
>y : typeof Y
>Point : typeof Point
module K {
>K : typeof K
export class L {
>L : L
constructor(public name: string) { }
>name : string
}
export module L {
>L : typeof L
export var y = 12;
>y : number
export interface Point {
>Point : Point
x: number;
>x : number
y: number;
>y : number
}
}
}
module M {
>M : typeof M
export import D = K.L;
>D : typeof L
>K : L
>L : L
}
var o: { name: string };
>o : { name: string; }
>name : string
var o = new M.D('Hello');
>o : { name: string; }
>new M.D('Hello') : L
>M.D : typeof L
>M : typeof M
>D : typeof L
var p: { x: number; y: number; }
>p : { x: number; y: number; }
>x : number
>y : number
var p: M.D.Point;
>p : { x: number; y: number; }
>M : M
>D : D
>Point : Point