File: voidOperatorWithAnyOtherType.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (236 lines) | stat: -rw-r--r-- 4,216 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
=== tests/cases/conformance/expressions/unaryOperators/voidOperator/voidOperatorWithAnyOtherType.ts ===
// void  operator on any type

var ANY: any;
>ANY : any

var ANY1;
>ANY1 : any

var ANY2: any[] = ["", ""];
>ANY2 : any[]
>["", ""] : string[]
>"" : ""
>"" : ""

var obj: () => {}
>obj : () => {}

var obj1 = {x:"",y:1};
>obj1 : { x: string; y: number; }
>{x:"",y:1} : { x: string; y: number; }
>x : string
>"" : ""
>y : number
>1 : 1

function foo(): any {
>foo : () => any

    var a;
>a : any

    return a;
>a : any
}
class A {
>A : A

    public a: any;
>a : any

    static foo() {
>foo : () => any

        var a;
>a : any

        return a;
>a : any
    }
}
module M {
>M : typeof M

    export var n: any;
>n : any
}
var objA = new A();
>objA : A
>new A() : A
>A : typeof A

// any type var
var ResultIsAny1 = void ANY1;
>ResultIsAny1 : any
>void ANY1 : undefined
>ANY1 : any

var ResultIsAny2 = void ANY2;
>ResultIsAny2 : any
>void ANY2 : undefined
>ANY2 : any[]

var ResultIsAny3 = void A;
>ResultIsAny3 : any
>void A : undefined
>A : typeof A

var ResultIsAny4 = void M;
>ResultIsAny4 : any
>void M : undefined
>M : typeof M

var ResultIsAny5 = void obj;
>ResultIsAny5 : any
>void obj : undefined
>obj : () => {}

var ResultIsAny6 = void obj1;
>ResultIsAny6 : any
>void obj1 : undefined
>obj1 : { x: string; y: number; }

// any type literal
var ResultIsAny7 = void undefined;
>ResultIsAny7 : any
>void undefined : undefined
>undefined : undefined

var ResultIsAny8 = void null;
>ResultIsAny8 : any
>void null : undefined
>null : null

// any type expressions
var ResultIsAny9 = void ANY2[0]
>ResultIsAny9 : any
>void ANY2[0] : undefined
>ANY2[0] : any
>ANY2 : any[]
>0 : 0

var ResultIsAny10 = void obj1.x;
>ResultIsAny10 : any
>void obj1.x : undefined
>obj1.x : string
>obj1 : { x: string; y: number; }
>x : string

var ResultIsAny11 = void obj1.y;
>ResultIsAny11 : any
>void obj1.y : undefined
>obj1.y : number
>obj1 : { x: string; y: number; }
>y : number

var ResultIsAny12 = void objA.a;
>ResultIsAny12 : any
>void objA.a : undefined
>objA.a : any
>objA : A
>a : any

var ResultIsAny13 = void M.n;
>ResultIsAny13 : any
>void M.n : undefined
>M.n : any
>M : typeof M
>n : any

var ResultIsAny14 = void foo();
>ResultIsAny14 : any
>void foo() : undefined
>foo() : any
>foo : () => any

var ResultIsAny15 = void A.foo();
>ResultIsAny15 : any
>void A.foo() : undefined
>A.foo() : any
>A.foo : () => any
>A : typeof A
>foo : () => any

var ResultIsAny16 = void (ANY + ANY1);
>ResultIsAny16 : any
>void (ANY + ANY1) : undefined
>(ANY + ANY1) : any
>ANY + ANY1 : any
>ANY : any
>ANY1 : any

var ResultIsAny17 = void (null + undefined);
>ResultIsAny17 : any
>void (null + undefined) : undefined
>(null + undefined) : any
>null + undefined : any
>null : null
>undefined : undefined

var ResultIsAny18 = void (null + null);
>ResultIsAny18 : any
>void (null + null) : undefined
>(null + null) : any
>null + null : any
>null : null
>null : null

var ResultIsAny19 = void (undefined + undefined);
>ResultIsAny19 : any
>void (undefined + undefined) : undefined
>(undefined + undefined) : any
>undefined + undefined : any
>undefined : undefined
>undefined : undefined

// multiple void  operators
var ResultIsAny20 = void void ANY;
>ResultIsAny20 : any
>void void ANY : undefined
>void ANY : undefined
>ANY : any

var ResultIsAny21 = void void void (ANY + ANY1);
>ResultIsAny21 : any
>void void void (ANY + ANY1) : undefined
>void void (ANY + ANY1) : undefined
>void (ANY + ANY1) : undefined
>(ANY + ANY1) : any
>ANY + ANY1 : any
>ANY : any
>ANY1 : any

// miss assignment operators
void ANY;
>void ANY : undefined
>ANY : any

void ANY1;
>void ANY1 : undefined
>ANY1 : any

void ANY2[0];
>void ANY2[0] : undefined
>ANY2[0] : any
>ANY2 : any[]
>0 : 0

void ANY, ANY1;
>void ANY, ANY1 : any
>void ANY : undefined
>ANY : any
>ANY1 : any

void objA.a;
>void objA.a : undefined
>objA.a : any
>objA : A
>a : any

void M.n;
>void M.n : undefined
>M.n : any
>M : typeof M
>n : any