1
+ overshifts.ts(2,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
2
+ overshifts.ts(3,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 27`.
3
+ overshifts.ts(4,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
4
+ overshifts.ts(6,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
5
+ overshifts.ts(7,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << -27`.
6
+ overshifts.ts(8,1): suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
7
+ overshifts.ts(11,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
8
+ overshifts.ts(12,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 27`.
9
+ overshifts.ts(13,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
10
+ overshifts.ts(15,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
11
+ overshifts.ts(16,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> -27`.
12
+ overshifts.ts(17,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
13
+ overshifts.ts(20,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
14
+ overshifts.ts(21,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 27`.
15
+ overshifts.ts(22,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
16
+ overshifts.ts(24,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
17
+ overshifts.ts(25,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> -27`.
18
+ overshifts.ts(26,1): suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
19
+ overshifts.ts(30,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
20
+ overshifts.ts(31,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 27`.
21
+ overshifts.ts(32,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
22
+ overshifts.ts(34,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
23
+ overshifts.ts(35,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= -27`.
24
+ overshifts.ts(36,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
25
+ overshifts.ts(39,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
26
+ overshifts.ts(40,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 27`.
27
+ overshifts.ts(41,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
28
+ overshifts.ts(43,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
29
+ overshifts.ts(44,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= -27`.
30
+ overshifts.ts(45,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
31
+ overshifts.ts(48,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
32
+ overshifts.ts(49,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 27`.
33
+ overshifts.ts(50,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
34
+ overshifts.ts(52,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
35
+ overshifts.ts(53,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= -27`.
36
+ overshifts.ts(54,1): suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
1
37
overshifts.ts(58,9): error TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
2
38
overshifts.ts(59,9): error TS6807: This operation can be simplified. This shift is identical to `1 << 27`.
3
39
overshifts.ts(60,9): error TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
@@ -18,61 +54,133 @@ overshifts.ts(85,9): error TS6807: This operation can be simplified. This shift
18
54
overshifts.ts(86,9): error TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
19
55
20
56
21
- ==== overshifts.ts (18 errors) ====
57
+ ==== overshifts.ts (54 errors) ====
22
58
1 << 1; // ok
23
59
1 << 32; // overshift
60
+ ~~~~~~~
61
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
24
62
1 << 123;
63
+ ~~~~~~~~
64
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 27`.
25
65
1 << 1024;
66
+ ~~~~~~~~~
67
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
26
68
1 << -1; // OK-ish
27
69
1 << -32; // backwards overshift
70
+ ~~~~~~~~
71
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
28
72
1 << -123;
73
+ ~~~~~~~~~
74
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << -27`.
29
75
1 << -1024;
76
+ ~~~~~~~~~~
77
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.
30
78
31
79
0xFF_FF_FF_FF >> 1; // ok
32
80
0xFF_FF_FF_FF >> 32; // overshift
81
+ ~~~~~~~~~~~~~~~~~~~
82
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
33
83
0xFF_FF_FF_FF >> 123;
84
+ ~~~~~~~~~~~~~~~~~~~~
85
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 27`.
34
86
0xFF_FF_FF_FF >> 1024;
87
+ ~~~~~~~~~~~~~~~~~~~~~
88
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
35
89
0xFF_FF_FF_FF >> -1; // OK-ish
36
90
0xFF_FF_FF_FF >> -32; // backwards overshift
91
+ ~~~~~~~~~~~~~~~~~~~~
92
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
37
93
0xFF_FF_FF_FF >> -123;
94
+ ~~~~~~~~~~~~~~~~~~~~~
95
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> -27`.
38
96
0xFF_FF_FF_FF >> -1024;
97
+ ~~~~~~~~~~~~~~~~~~~~~~
98
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >> 0`.
39
99
40
100
0xFF_FF_FF_FF >>> 1; // ok
41
101
0xFF_FF_FF_FF >>> 32; // overshift
102
+ ~~~~~~~~~~~~~~~~~~~~
103
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
42
104
0xFF_FF_FF_FF >>> 123;
105
+ ~~~~~~~~~~~~~~~~~~~~~
106
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 27`.
43
107
0xFF_FF_FF_FF >>> 1024;
108
+ ~~~~~~~~~~~~~~~~~~~~~~
109
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
44
110
0xFF_FF_FF_FF >>> -1; // OK-ish
45
111
0xFF_FF_FF_FF >>> -32; // backwards overshift
112
+ ~~~~~~~~~~~~~~~~~~~~~
113
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
46
114
0xFF_FF_FF_FF >>> -123;
115
+ ~~~~~~~~~~~~~~~~~~~~~~
116
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> -27`.
47
117
0xFF_FF_FF_FF >>> -1024;
118
+ ~~~~~~~~~~~~~~~~~~~~~~~
119
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `0xFF_FF_FF_FF >>> 0`.
48
120
49
121
let x = 1;
50
122
x <<= 1; // ok
51
123
x <<= 32; // overshift
124
+ ~~~~~~~~
125
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
52
126
x <<= 123;
127
+ ~~~~~~~~~
128
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 27`.
53
129
x <<= 1024;
130
+ ~~~~~~~~~~
131
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
54
132
x <<= -1; // OK-ish
55
133
x <<= -32; // backwards overshift
134
+ ~~~~~~~~~
135
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
56
136
x <<= -123;
137
+ ~~~~~~~~~~
138
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= -27`.
57
139
x <<= -1024;
140
+ ~~~~~~~~~~~
141
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x <<= 0`.
58
142
59
143
x >>= 1; // ok
60
144
x >>= 32; // overshift
145
+ ~~~~~~~~
146
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
61
147
x >>= 123;
148
+ ~~~~~~~~~
149
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 27`.
62
150
x >>= 1024;
151
+ ~~~~~~~~~~
152
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
63
153
x >>= -1; // OK-ish
64
154
x >>= -32; // backwards overshift
155
+ ~~~~~~~~~
156
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
65
157
x >>= -123;
158
+ ~~~~~~~~~~
159
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= -27`.
66
160
x >>= -1024;
161
+ ~~~~~~~~~~~
162
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>= 0`.
67
163
68
164
x >>>= 1; // ok
69
165
x >>>= 32; // overshift
166
+ ~~~~~~~~~
167
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
70
168
x >>>= 123;
169
+ ~~~~~~~~~~
170
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 27`.
71
171
x >>>= 1024;
172
+ ~~~~~~~~~~~
173
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
72
174
x >>>= -1; // OK-ish
73
175
x >>>= -32; // backwards overshift
176
+ ~~~~~~~~~~
177
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
74
178
x >>>= -123;
179
+ ~~~~~~~~~~~
180
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= -27`.
75
181
x >>>= -1024;
182
+ ~~~~~~~~~~~~
183
+ !!! suggestion TS6807: This operation can be simplified. This shift is identical to `x >>>= 0`.
76
184
77
185
enum One {
78
186
A = 1 << 1, // ok
0 commit comments