vxx2 / vlib / v / checker / tests / shift_ops_expressions.out
175 lines · 175 sloc · 5.92 KB · 9760a9c6b258017ed728d323cbcd3f7016c40c3b
Raw
1vlib/v/checker/tests/shift_ops_expressions.vv:4:2: notice: shifting a value from a signed type `int` can change the sign
2 2 | mut a := 12
3 3 | mut arr := []int{}
4 4 | a << 1
5 | ^
6 5 | if true {
7 6 | a << 2
8vlib/v/checker/tests/shift_ops_expressions.vv:5:5: notice: condition is always true
9 3 | mut arr := []int{}
10 4 | a << 1
11 5 | if true {
12 | ~~~~
13 6 | a << 2
14 7 | }
15vlib/v/checker/tests/shift_ops_expressions.vv:6:3: notice: shifting a value from a signed type `int` can change the sign
16 4 | a << 1
17 5 | if true {
18 6 | a << 2
19 | ^
20 7 | }
21 8 | c := if true { a << 111 } else { a << 333 }
22vlib/v/checker/tests/shift_ops_expressions.vv:8:10: notice: condition is always true
23 6 | a << 2
24 7 | }
25 8 | c := if true { a << 111 } else { a << 333 }
26 | ~~~~
27 9 | println(c)
28 10 | a << 1
29vlib/v/checker/tests/shift_ops_expressions.vv:8:17: notice: shifting a value from a signed type `int` can change the sign
30 6 | a << 2
31 7 | }
32 8 | c := if true { a << 111 } else { a << 333 }
33 | ^
34 9 | println(c)
35 10 | a << 1
36vlib/v/checker/tests/shift_ops_expressions.vv:10:2: notice: shifting a value from a signed type `int` can change the sign
37 8 | c := if true { a << 111 } else { a << 333 }
38 9 | println(c)
39 10 | a << 1
40 | ^
41 11 | println(a)
42 12 | 5 << 9
43vlib/v/checker/tests/shift_ops_expressions.vv:20:5: notice: condition is always true
44 18 | //
45 19 | arr << 1
46 20 | if true {
47 | ~~~~
48 21 | arr << 2
49 22 | }
50vlib/v/checker/tests/shift_ops_expressions.vv:23:10: notice: condition is always true
51 21 | arr << 2
52 22 | }
53 23 | d := if true {
54 | ~~~~
55 24 | arr << 111
56 25 | 777
57vlib/v/checker/tests/shift_ops_expressions.vv:32:10: notice: condition is always true
58 30 | println(d)
59 31 | //
60 32 | x := if true {
61 | ~~~~
62 33 | a << 1
63 34 | 999
64vlib/v/checker/tests/shift_ops_expressions.vv:33:3: notice: shifting a value from a signed type `int` can change the sign
65 31 | //
66 32 | x := if true {
67 33 | a << 1
68 | ^
69 34 | 999
70 35 | } else {
71vlib/v/checker/tests/shift_ops_expressions.vv:37:3: notice: shifting a value from a signed type `int` can change the sign
72 35 | } else {
73 36 | println('---')
74 37 | a << 9999
75 | ^
76 38 | println('---')
77 39 | 555
78vlib/v/checker/tests/shift_ops_expressions.vv:47:5: notice: condition is always true
79 45 | mut rr := 12
80 46 | rr >> 1
81 47 | if true {
82 | ~~~~
83 48 | rr >> 2
84 49 | }
85vlib/v/checker/tests/shift_ops_expressions.vv:50:10: notice: condition is always true
86 48 | rr >> 2
87 49 | }
88 50 | c := if true { rr >> 111 } else { rr >> 333 }
89 | ~~~~
90 51 | println(c)
91 52 | rr >> 1
92vlib/v/checker/tests/shift_ops_expressions.vv:61:10: notice: condition is always true
93 59 | }
94 60 | //
95 61 | x := if true {
96 | ~~~~
97 62 | rr >> 1
98 63 | 999
99vlib/v/checker/tests/shift_ops_expressions.vv:4:2: error: unused expression
100 2 | mut a := 12
101 3 | mut arr := []int{}
102 4 | a << 1
103 | ~~~~~~
104 5 | if true {
105 6 | a << 2
106vlib/v/checker/tests/shift_ops_expressions.vv:6:3: error: unused expression
107 4 | a << 1
108 5 | if true {
109 6 | a << 2
110 | ~~~~~~
111 7 | }
112 8 | c := if true { a << 111 } else { a << 333 }
113vlib/v/checker/tests/shift_ops_expressions.vv:8:22: error: shift count for type `int` too large (maximum: 31 bits)
114 6 | a << 2
115 7 | }
116 8 | c := if true { a << 111 } else { a << 333 }
117 | ~~~
118 9 | println(c)
119 10 | a << 1
120vlib/v/checker/tests/shift_ops_expressions.vv:10:2: error: unused expression
121 8 | c := if true { a << 111 } else { a << 333 }
122 9 | println(c)
123 10 | a << 1
124 | ~~~~~~
125 11 | println(a)
126 12 | 5 << 9
127vlib/v/checker/tests/shift_ops_expressions.vv:12:2: error: unused expression
128 10 | a << 1
129 11 | println(a)
130 12 | 5 << 9
131 | ~~~~~~
132 13 | for i in 0 .. 10 {
133 14 | z := i << 5
134vlib/v/checker/tests/shift_ops_expressions.vv:15:3: error: unused expression
135 13 | for i in 0 .. 10 {
136 14 | z := i << 5
137 15 | i << 5
138 | ~~~~~~
139 16 | println(z)
140 17 | }
141vlib/v/checker/tests/shift_ops_expressions.vv:33:3: error: unused expression
142 31 | //
143 32 | x := if true {
144 33 | a << 1
145 | ~~~~~~
146 34 | 999
147 35 | } else {
148vlib/v/checker/tests/shift_ops_expressions.vv:37:8: error: shift count for type `int` too large (maximum: 31 bits)
149 35 | } else {
150 36 | println('---')
151 37 | a << 9999
152 | ~~~~
153 38 | println('---')
154 39 | 555
155vlib/v/checker/tests/shift_ops_expressions.vv:37:3: error: unused expression
156 35 | } else {
157 36 | println('---')
158 37 | a << 9999
159 | ~~~~~~~~~
160 38 | println('---')
161 39 | 555
162vlib/v/checker/tests/shift_ops_expressions.vv:50:23: error: shift count for type `int` too large (maximum: 31 bits)
163 48 | rr >> 2
164 49 | }
165 50 | c := if true { rr >> 111 } else { rr >> 333 }
166 | ~~~
167 51 | println(c)
168 52 | rr >> 1
169vlib/v/checker/tests/shift_ops_expressions.vv:66:9: error: shift count for type `int` too large (maximum: 31 bits)
170 64 | } else {
171 65 | println('---')
172 66 | rr >> 9999
173 | ~~~~
174 67 | println('---')
175 68 | 555
176