diff --git a/vlib/v/checker/check_types.v b/vlib/v/checker/check_types.v index 96143b9e5f..795348f87f 100644 --- a/vlib/v/checker/check_types.v +++ b/vlib/v/checker/check_types.v @@ -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() { diff --git a/vlib/v/checker/tests/rshift_op_wrong_left_type_err.out b/vlib/v/checker/tests/rshift_op_wrong_left_type_err.out index 34b4621422..3bd0193aac 100644 --- a/vlib/v/checker/tests/rshift_op_wrong_left_type_err.out +++ b/vlib/v/checker/tests/rshift_op_wrong_left_type_err.out @@ -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) | ~~~ diff --git a/vlib/v/checker/tests/shift_op_wrong_left_type_err.out b/vlib/v/checker/tests/shift_op_wrong_left_type_err.out index 209ae4dfe5..4c78d698e2 100644 --- a/vlib/v/checker/tests/shift_op_wrong_left_type_err.out +++ b/vlib/v/checker/tests/shift_op_wrong_left_type_err.out @@ -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) | ~~~