File: inferringClassStaticMembersFromAssignments.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (150 lines) | stat: -rw-r--r-- 2,794 bytes parent folder | download | duplicates (5)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
=== tests/cases/conformance/salsa/a.js ===
export class C1 { }
>C1 : C1

C1.staticProp = 0;
>C1.staticProp = 0 : 0
>C1.staticProp : number
>C1 : typeof C1
>staticProp : number
>0 : 0

export function F1() { }
>F1 : typeof F1

F1.staticProp = 0;
>F1.staticProp = 0 : 0
>F1.staticProp : number
>F1 : typeof F1
>staticProp : number
>0 : 0

export var C2 = class { };
>C2 : typeof C2
>class { } : typeof C2

C2.staticProp = 0;
>C2.staticProp = 0 : 0
>C2.staticProp : number
>C2 : typeof C2
>staticProp : number
>0 : 0

export let F2 = function () { };
>F2 : { (): void; staticProp: number; }
>function () { } : { (): void; staticProp: number; }

F2.staticProp = 0;
>F2.staticProp = 0 : 0
>F2.staticProp : number
>F2 : { (): void; staticProp: number; }
>staticProp : number
>0 : 0

=== tests/cases/conformance/salsa/global.js ===
class C3 { }
>C3 : C3

C3.staticProp = 0;
>C3.staticProp = 0 : 0
>C3.staticProp : number
>C3 : typeof C3
>staticProp : number
>0 : 0

function F3() { }
>F3 : typeof F3

F3.staticProp = 0;
>F3.staticProp = 0 : 0
>F3.staticProp : number
>F3 : typeof F3
>staticProp : number
>0 : 0

var C4 = class { };
>C4 : typeof C4
>class { } : typeof C4

C4.staticProp = 0;
>C4.staticProp = 0 : 0
>C4.staticProp : number
>C4 : typeof C4
>staticProp : number
>0 : 0

let F4 = function () { };
>F4 : { (): void; staticProp: number; }
>function () { } : { (): void; staticProp: number; }

F4.staticProp = 0;
>F4.staticProp = 0 : 0
>F4.staticProp : number
>F4 : { (): void; staticProp: number; }
>staticProp : number
>0 : 0

=== tests/cases/conformance/salsa/b.ts ===
import * as a from "./a";
>a : typeof a

var n: number;
>n : number

var n = a.C1.staticProp;
>n : number
>a.C1.staticProp : number
>a.C1 : typeof a.C1
>a : typeof a
>C1 : typeof a.C1
>staticProp : number

var n = a.C2.staticProp;
>n : number
>a.C2.staticProp : number
>a.C2 : typeof C2
>a : typeof a
>C2 : typeof C2
>staticProp : number

var n = a.F1.staticProp;
>n : number
>a.F1.staticProp : number
>a.F1 : typeof a.F1
>a : typeof a
>F1 : typeof a.F1
>staticProp : number

var n = a.F2.staticProp;
>n : number
>a.F2.staticProp : number
>a.F2 : { (): void; staticProp: number; }
>a : typeof a
>F2 : { (): void; staticProp: number; }
>staticProp : number


var n = C3.staticProp;
>n : number
>C3.staticProp : number
>C3 : typeof C3
>staticProp : number

var n = C4.staticProp;
>n : number
>C4.staticProp : number
>C4 : typeof C4
>staticProp : number

var n = F3.staticProp;
>n : number
>F3.staticProp : number
>F3 : typeof F3
>staticProp : number

var n = F4.staticProp;
>n : number
>F4.staticProp : number
>F4 : { (): void; staticProp: number; }
>staticProp : number