forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassAndModuleWithSameNameAndCommonRoot.types
108 lines (89 loc) · 1.86 KB
/
ClassAndModuleWithSameNameAndCommonRoot.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
=== tests/cases/conformance/internalModules/DeclarationMerging/class.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export class Point {
>Point : Point
constructor(x: number, y: number) {
>x : number
>y : number
this.x = x;
>this.x = x : number
>this.x : number
>this : this
>x : number
>x : number
this.y = y;
>this.y = y : number
>this.y : number
>this : this
>y : number
>y : number
}
x: number;
>x : number
y: number;
>y : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export module Point {
>Point : typeof Point
export var Origin = new Point(0, 0);
>Origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
>0 : 0
>0 : 0
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1,1);
>cl : X.Y.Point
>new X.Y.Point(1,1) : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>1 : 1
>1 : 1
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
>cl : X.Y.Point
>X.Y.Point.Origin : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>Origin : X.Y.Point
=== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts ===
class A {
>A : A
id: string;
>id : string
}
module A {
>A : typeof A
export var Instance = new A();
>Instance : A
>new A() : A
>A : typeof A
}
// ensure merging works as expected
var a = A.Instance;
>a : A
>A.Instance : A
>A : typeof A
>Instance : A
var a = new A();
>a : A
>new A() : A
>A : typeof A
var a: { id: string };
>a : A
>id : string