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:
parent
6d72209363
commit
2dd82748e0
@ -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() {
|
||||
|
@ -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)
|
||||
| ~~~
|
||||
|
@ -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)
|
||||
| ~~~
|
||||
|
Loading…
Reference in New Issue
Block a user