From 09d743ac8121c01f8bcb2ef72b21f27ee0a7741a Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 20 Jul 2023 18:51:47 +0800 Subject: [PATCH] cgen: minor cleanup in infix_expr_arithmetic_op() (#18913) --- vlib/v/gen/c/infix.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/c/infix.v b/vlib/v/gen/c/infix.v index 0d74b77a94..2e6e28087a 100644 --- a/vlib/v/gen/c/infix.v +++ b/vlib/v/gen/c/infix.v @@ -723,10 +723,9 @@ fn (mut g Gen) gen_interface_is_op(node ast.InfixExpr) { fn (mut g Gen) infix_expr_arithmetic_op(node ast.InfixExpr) { left := g.unwrap(node.left_type) right := g.unwrap(node.right_type) - if left.sym.kind == .struct_ && (left.sym.info as ast.Struct).generic_types.len > 0 { - concrete_types := (left.sym.info as ast.Struct).concrete_types + if left.sym.info is ast.Struct && left.sym.info.generic_types.len > 0 { mut method_name := left.sym.cname + '_' + util.replace_op(node.op.str()) - method_name = g.generic_fn_name(concrete_types, method_name) + method_name = g.generic_fn_name(left.sym.info.concrete_types, method_name) g.write(method_name) g.write('(') g.expr(node.left)