diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index fcd25b455a..357e7b6c5e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -576,8 +576,8 @@ pub fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type { left_right_pos := left_pos.extend(right_pos) if left_type.is_any_kind_of_pointer() && node.op in [.plus, .minus, .mul, .div, .mod, .xor, .amp, .pipe] { - if (right_type.is_any_kind_of_pointer() && node.op != .minus) - || (!right_type.is_any_kind_of_pointer() && node.op !in [.plus, .minus]) { + if !c.pref.translated && ((right_type.is_any_kind_of_pointer() && node.op != .minus) + || (!right_type.is_any_kind_of_pointer() && node.op !in [.plus, .minus])) { left_name := c.table.type_to_str(left_type) right_name := c.table.type_to_str(right_type) c.error('invalid operator `$node.op` to `$left_name` and `$right_name`', left_right_pos)