TypeScript/tests/baselines/reference/exportImportAlias.types

176 lines
2.7 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/internalModules/importDeclarations/exportImportAlias.ts ===
// expect no errors here
module A {
2014-08-28 21:40:58 +02:00
>A : typeof A
2014-08-15 23:33:16 +02:00
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 {
2014-08-28 21:40:58 +02:00
>B : unknown
2014-08-15 23:33:16 +02:00
export interface Id {
>Id : Id
name: string;
>name : string
}
}
}
module C {
2014-08-28 21:40:58 +02:00
>C : typeof C
2014-08-15 23:33:16 +02:00
export 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 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
2014-08-25 19:36:12 +02:00
>new C.a.Point(0, 0) : A.Point
>C.a.Point : typeof A.Point
2014-08-15 23:33:16 +02:00
>C.a : typeof A
>C : typeof C
>a : typeof A
2014-08-25 19:36:12 +02:00
>Point : typeof A.Point
2014-08-15 23:33:16 +02:00
var c: { name: string };
>c : { name: string; }
>name : string
var c: C.a.B.Id;
>c : { name: string; }
2014-08-28 21:40:58 +02:00
>C : unknown
>a : unknown
>B : unknown
2014-08-25 19:36:12 +02:00
>Id : A.B.Id
2014-08-15 23:33:16 +02:00
module X {
2014-08-28 21:40:58 +02:00
>X : typeof X
2014-08-15 23:33:16 +02:00
export function Y() {
>Y : typeof Y
return 42;
}
export module Y {
2014-08-28 21:40:58 +02:00
>Y : typeof Y
2014-08-15 23:33:16 +02:00
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
}
}
}
module Z {
2014-08-28 21:40:58 +02:00
>Z : typeof Z
2014-08-15 23:33:16 +02:00
// 'y' should be a fundule here
export import y = X.Y;
2014-08-28 21:40:58 +02:00
>y : typeof y
>X : typeof X
2014-08-25 19:36:12 +02:00
>Y : typeof y
2014-08-15 23:33:16 +02:00
}
var m: number = Z.y();
>m : number
>Z.y() : number
2014-08-25 19:36:12 +02:00
>Z.y : typeof X.Y
2014-08-15 23:33:16 +02:00
>Z : typeof Z
2014-08-25 19:36:12 +02:00
>y : typeof X.Y
2014-08-15 23:33:16 +02:00
var n: { x: number; y: number; } = new Z.y.Point(0, 0);
>n : { x: number; y: number; }
>x : number
>y : number
2014-08-25 19:36:12 +02:00
>new Z.y.Point(0, 0) : X.Y.Point
>Z.y.Point : typeof X.Y.Point
>Z.y : typeof X.Y
2014-08-15 23:33:16 +02:00
>Z : typeof Z
2014-08-25 19:36:12 +02:00
>y : typeof X.Y
>Point : typeof X.Y.Point
2014-08-15 23:33:16 +02:00
module K {
2014-08-28 21:40:58 +02:00
>K : typeof K
2014-08-15 23:33:16 +02:00
export class L {
>L : L
constructor(public name: string) { }
>name : string
}
export module L {
2014-08-28 21:40:58 +02:00
>L : typeof L
2014-08-15 23:33:16 +02:00
export var y = 12;
>y : number
export interface Point {
>Point : Point
x: number;
>x : number
y: number;
>y : number
}
}
}
module M {
2014-08-28 21:40:58 +02:00
>M : typeof M
2014-08-15 23:33:16 +02:00
export import D = K.L;
2014-08-28 21:40:58 +02:00
>D : typeof D
>K : typeof K
2014-08-25 19:36:12 +02:00
>L : D
2014-08-15 23:33:16 +02:00
}
var o: { name: string };
>o : { name: string; }
>name : string
var o = new M.D('Hello');
>o : { name: string; }
2014-08-25 19:36:12 +02:00
>new M.D('Hello') : K.L
>M.D : typeof K.L
2014-08-15 23:33:16 +02:00
>M : typeof M
2014-08-25 19:36:12 +02:00
>D : typeof K.L
2014-08-15 23:33:16 +02:00
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; }
2014-08-28 21:40:58 +02:00
>M : unknown
>D : unknown
2014-08-25 19:36:12 +02:00
>Point : K.L.Point
2014-08-15 23:33:16 +02:00