File: negateOperatorWithAnyOtherType.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 (195 lines) | stat: -rw-r--r-- 3,204 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
=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts ===
// - operator on any type

var ANY: any;
>ANY : any

var ANY1: any;
>ANY1 : any

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

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

var obj1 = { x: "", y: () => { }};
>obj1 : { x: string; y: () => void; }
>{ x: "", y: () => { }} : { x: string; y: () => void; }
>x : string
>"" : ""
>y : () => void
>() => { } : () => void

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

    var a;
>a : any

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

    public a: any;
>a : any

    static foo(): any {
>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 ResultIsNumber1 = -ANY1;
>ResultIsNumber1 : number
>-ANY1 : number
>ANY1 : any

var ResultIsNumber2 = -ANY2;
>ResultIsNumber2 : number
>-ANY2 : number
>ANY2 : any[]

var ResultIsNumber3 = -A;
>ResultIsNumber3 : number
>-A : number
>A : typeof A

var ResultIsNumber4 = -M;
>ResultIsNumber4 : number
>-M : number
>M : typeof M

var ResultIsNumber5 = -obj;
>ResultIsNumber5 : number
>-obj : number
>obj : () => {}

var ResultIsNumber6 = -obj1;
>ResultIsNumber6 : number
>-obj1 : number
>obj1 : { x: string; y: () => void; }

// any type literal
var ResultIsNumber7 = -undefined;
>ResultIsNumber7 : number
>-undefined : number
>undefined : undefined

var ResultIsNumber = -null;
>ResultIsNumber : number
>-null : number
>null : null

// any type expressions
var ResultIsNumber8 = -ANY2[0];
>ResultIsNumber8 : number
>-ANY2[0] : number
>ANY2[0] : any
>ANY2 : any[]
>0 : 0

var ResultIsNumber9 = -obj1.x;
>ResultIsNumber9 : number
>-obj1.x : number
>obj1.x : string
>obj1 : { x: string; y: () => void; }
>x : string

var ResultIsNumber10 = -obj1.y;
>ResultIsNumber10 : number
>-obj1.y : number
>obj1.y : () => void
>obj1 : { x: string; y: () => void; }
>y : () => void

var ResultIsNumber11 = -objA.a;
>ResultIsNumber11 : number
>-objA.a : number
>objA.a : any
>objA : A
>a : any

var ResultIsNumber12 = -M.n;
>ResultIsNumber12 : number
>-M.n : number
>M.n : any
>M : typeof M
>n : any

var ResultIsNumber13 = -foo();
>ResultIsNumber13 : number
>-foo() : number
>foo() : any
>foo : () => any

var ResultIsNumber14 = -A.foo();
>ResultIsNumber14 : number
>-A.foo() : number
>A.foo() : any
>A.foo : () => any
>A : typeof A
>foo : () => any

var ResultIsNumber15 = -(ANY - ANY1);
>ResultIsNumber15 : number
>-(ANY - ANY1) : number
>(ANY - ANY1) : number
>ANY - ANY1 : number
>ANY : any
>ANY1 : any

// miss assignment operators
-ANY;
>-ANY : number
>ANY : any

-ANY1;
>-ANY1 : number
>ANY1 : any

-ANY2[0];
>-ANY2[0] : number
>ANY2[0] : any
>ANY2 : any[]
>0 : 0

-ANY, ANY1;
>-ANY, ANY1 : any
>-ANY : number
>ANY : any
>ANY1 : any

-objA.a;
>-objA.a : number
>objA.a : any
>objA : A
>a : any

-M.n;
>-M.n : number
>M.n : any
>M : typeof M
>n : any