cgen: fix c2v struct eq

master
Alexander Medvednikov 2022-05-17 03:39:48 +03:00
parent bc397bb0e1
commit d10f83ce15
1 changed files with 18 additions and 14 deletions

View File

@ -201,6 +201,9 @@ fn (mut g Gen) infix_expr_eq_op(node ast.InfixExpr) {
g.write(')')
}
.struct_ {
if g.pref.translated {
g.gen_plain_infix_expr(node)
} else {
ptr_typ := g.equality_fn(left.unaliased)
if node.op == .ne {
g.write('!')
@ -217,6 +220,7 @@ fn (mut g Gen) infix_expr_eq_op(node ast.InfixExpr) {
g.expr(node.right)
g.write(')')
}
}
.sum_type {
ptr_typ := g.equality_fn(left.unaliased)
if node.op == .ne {