1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: simplify << error message

This commit is contained in:
Alexander Medvednikov 2020-08-11 01:01:33 +02:00
parent 6d72209363
commit 2dd82748e0
3 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ pub fn (mut c Checker) check_matching_function_symbols(got_type_sym, exp_type_sy
[inline]
fn (mut c Checker) check_shift(left_type, right_type table.Type, left_pos, right_pos token.Position) table.Type {
if !left_type.is_int() {
c.error('cannot shift type ${c.table.get_type_symbol(right_type).name} into non-integer type ${c.table.get_type_symbol(left_type).name}',
c.error('invalid operation: shift of type `${c.table.get_type_symbol(left_type).name}`',
left_pos)
return table.void_type
} else if !right_type.is_int() {

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/rshift_op_wrong_left_type_err.v:2:10: error: cannot shift type any_int into non-integer type any_float
vlib/v/checker/tests/rshift_op_wrong_left_type_err.v:2:10: error: invalid operation: shift of type `any_float`
1 | fn main() {
2 | println(0.5 >> 1)
| ~~~

View File

@ -1,4 +1,4 @@
vlib/v/checker/tests/shift_op_wrong_left_type_err.v:2:10: error: cannot shift type any_int into non-integer type any_float
vlib/v/checker/tests/shift_op_wrong_left_type_err.v:2:10: error: invalid operation: shift of type `any_float`
1 | fn main() {
2 | println(0.5 << 1)
| ~~~