From 245d28d57a7793bcce6b82f3994ea59832cc18cd Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 22 May 2022 14:53:17 +0300 Subject: [PATCH] checker: c2v infix fix --- vlib/v/checker/infix.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/infix.v b/vlib/v/checker/infix.v index ff01115dae..0846c49d28 100644 --- a/vlib/v/checker/infix.v +++ b/vlib/v/checker/infix.v @@ -594,7 +594,8 @@ pub fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type { left_right_pos) } else if left_type.is_ptr() { for_ptr_op := c.table.type_is_for_pointer_arithmetic(left_type) - if left_sym.language == .v && !c.inside_unsafe && !for_ptr_op && right_type.is_int() { + if left_sym.language == .v && !c.pref.translated && !c.inside_unsafe && !for_ptr_op + && right_type.is_int() { sugg := ' (you can use it inside an `unsafe` block)' c.error('infix expr: cannot use `$right_sym.name` (right expression) as `$left_sym.name` $sugg', left_right_pos)