From 76215a184d90282bceffd3e9e2c498d0ee657b0d Mon Sep 17 00:00:00 2001 From: Swastik Date: Fri, 17 May 2024 00:47:49 +0530 Subject: [PATCH] fix cond --- vlib/v/checker/infix.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/infix.v b/vlib/v/checker/infix.v index 4a504eb23123fe..560f14bfa98fed 100644 --- a/vlib/v/checker/infix.v +++ b/vlib/v/checker/infix.v @@ -331,8 +331,9 @@ fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type { } } - if (unwrapped_left_type.is_any_kind_of_pointer() - || unwrapped_right_type.is_any_kind_of_pointer()) && node.op !in [.plus, .minus] { + if ((unwrapped_left_type.is_ptr() && !node.left.is_auto_deref_var()) + || (unwrapped_right_type.is_ptr() && !node.right.is_auto_deref_var())) + && node.op !in [.plus, .minus] { c.error('infix `${node.op}` is not defined for pointer values', left_right_pos) }