forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFunctionAndModuleWithSameNameAndCommonRoot.types
More file actions
127 lines (104 loc) · 2.6 KB
/
FunctionAndModuleWithSameNameAndCommonRoot.types
File metadata and controls
127 lines (104 loc) · 2.6 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//// [tests/cases/conformance/internalModules/DeclarationMerging/FunctionAndModuleWithSameNameAndCommonRoot.ts] ////
=== function.ts ===
module A {
>A : typeof A
export function Point() {
>Point : typeof Point
return { x: 0, y: 0 };
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
}
=== module.ts ===
module A {
>A : typeof A
export module Point {
>Point : typeof Point
export var Origin = { x: 0, y: 0 };
>Origin : { x: number; y: number; }
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
}
=== test.ts ===
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number; }
>x : number
>y : number
var fn = A.Point;
>fn : () => { x: number; y: number; }
>A.Point : typeof A.Point
>A : typeof A
>Point : typeof A.Point
var cl: { x: number; y: number; }
>cl : { x: number; y: number; }
>x : number
>y : number
var cl = A.Point();
>cl : { x: number; y: number; }
>A.Point() : { x: number; y: number; }
>A.Point : typeof A.Point
>A : typeof A
>Point : typeof A.Point
var cl = A.Point.Origin; // not expected to be an error.
>cl : { x: number; y: number; }
>A.Point.Origin : { x: number; y: number; }
>A.Point : typeof A.Point
>A : typeof A
>Point : typeof A.Point
>Origin : { x: number; y: number; }
=== simple.ts ===
module B {
>B : typeof B
export function Point() {
>Point : typeof Point
return { x: 0, y: 0 };
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
export module Point {
>Point : typeof Point
export var Origin = { x: 0, y: 0 };
>Origin : { x: number; y: number; }
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
}
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number; }
>x : number
>y : number
var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected
>fn : () => { x: number; y: number; }
>B.Point : typeof B.Point
>B : typeof B
>Point : typeof B.Point
var cl: { x: number; y: number; }
>cl : { x: number; y: number; }
>x : number
>y : number
var cl = B.Point();
>cl : { x: number; y: number; }
>B.Point() : { x: number; y: number; }
>B.Point : typeof B.Point
>B : typeof B
>Point : typeof B.Point
var cl = B.Point.Origin;
>cl : { x: number; y: number; }
>B.Point.Origin : { x: number; y: number; }
>B.Point : typeof B.Point
>B : typeof B
>Point : typeof B.Point
>Origin : { x: number; y: number; }