File: commaOperatorWithSecondOperandAnyType.types

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (182 lines) | stat: -rw-r--r-- 3,353 bytes parent folder | download | duplicates (2)
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
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===

var ANY: any;
>ANY : any

var BOOLEAN: boolean;
>BOOLEAN : boolean

var NUMBER: number;
>NUMBER : number

var STRING: string;
>STRING : string

var OBJECT: Object;
>OBJECT : Object
>Object : Object

//The second operand type is any
ANY, ANY;
>ANY, ANY : any
>ANY : any
>ANY : any

BOOLEAN, ANY;
>BOOLEAN, ANY : any
>BOOLEAN : boolean
>ANY : any

NUMBER, ANY;
>NUMBER, ANY : any
>NUMBER : number
>ANY : any

STRING, ANY;
>STRING, ANY : any
>STRING : string
>ANY : any

OBJECT, ANY;
>OBJECT, ANY : any
>OBJECT : Object
>ANY : any

//Return type is any
var resultIsAny1 = (ANY, ANY);
>resultIsAny1 : any
>(ANY, ANY) : any
>ANY, ANY : any
>ANY : any
>ANY : any

var resultIsAny2 = (BOOLEAN, ANY);
>resultIsAny2 : any
>(BOOLEAN, ANY) : any
>BOOLEAN, ANY : any
>BOOLEAN : boolean
>ANY : any

var resultIsAny3 = (NUMBER, ANY);
>resultIsAny3 : any
>(NUMBER, ANY) : any
>NUMBER, ANY : any
>NUMBER : number
>ANY : any

var resultIsAny4 = (STRING, ANY);
>resultIsAny4 : any
>(STRING, ANY) : any
>STRING, ANY : any
>STRING : string
>ANY : any

var resultIsAny5 = (OBJECT, ANY);
>resultIsAny5 : any
>(OBJECT, ANY) : any
>OBJECT, ANY : any
>OBJECT : Object
>ANY : any

//Literal and expression
var x: any;
>x : any

1, ANY;
>1, ANY : any
>1 : 1
>ANY : any

++NUMBER, ANY;
>++NUMBER, ANY : any
>++NUMBER : number
>NUMBER : number
>ANY : any

"string", [null, 1];
>"string", [null, 1] : number[]
>"string" : "string"
>[null, 1] : number[]
>null : null
>1 : 1

"string".charAt(0), [null, 1];
>"string".charAt(0), [null, 1] : number[]
>"string".charAt(0) : string
>"string".charAt : (pos: number) => string
>"string" : "string"
>charAt : (pos: number) => string
>0 : 0
>[null, 1] : number[]
>null : null
>1 : 1

true, x("any");
>true, x("any") : any
>true : true
>x("any") : any
>x : any
>"any" : "any"

!BOOLEAN, x.doSomeThing();
>!BOOLEAN, x.doSomeThing() : any
>!BOOLEAN : boolean
>BOOLEAN : boolean
>x.doSomeThing() : any
>x.doSomeThing : any
>x : any
>doSomeThing : any

var resultIsAny6 = (1, ANY);
>resultIsAny6 : any
>(1, ANY) : any
>1, ANY : any
>1 : 1
>ANY : any

var resultIsAny7 = (++NUMBER, ANY);
>resultIsAny7 : any
>(++NUMBER, ANY) : any
>++NUMBER, ANY : any
>++NUMBER : number
>NUMBER : number
>ANY : any

var resultIsAny8 = ("string", null);
>resultIsAny8 : any
>("string", null) : null
>"string", null : null
>"string" : "string"
>null : null

var resultIsAny9 = ("string".charAt(0), undefined);
>resultIsAny9 : any
>("string".charAt(0), undefined) : undefined
>"string".charAt(0), undefined : undefined
>"string".charAt(0) : string
>"string".charAt : (pos: number) => string
>"string" : "string"
>charAt : (pos: number) => string
>0 : 0
>undefined : undefined

var resultIsAny10 = (true, x("any"));
>resultIsAny10 : any
>(true, x("any")) : any
>true, x("any") : any
>true : true
>x("any") : any
>x : any
>"any" : "any"

var resultIsAny11 = (!BOOLEAN, x.doSomeThing());
>resultIsAny11 : any
>(!BOOLEAN, x.doSomeThing()) : any
>!BOOLEAN, x.doSomeThing() : any
>!BOOLEAN : boolean
>BOOLEAN : boolean
>x.doSomeThing() : any
>x.doSomeThing : any
>x : any
>doSomeThing : any