@@ -495,14 +495,14 @@ fn (mut g Gen) infix_expr_in_optimization(left ast.Expr, right ast.ArrayInit) {
495495
496496// infix_expr_is_op generates code for `is` and `!is`
497497fn (mut g Gen) infix_expr_is_op (node ast.InfixExpr) {
498- mut sym := g.table.sym (node.left_type)
499- is_aggregate := sym .kind == .aggregate
498+ mut left_sym := g.table.sym (node.left_type)
499+ is_aggregate := left_sym .kind == .aggregate
500500 if is_aggregate {
501- parent_left_type := (sym .info as ast.Aggregate ).sum_type
502- sym = g.table.sym (parent_left_type)
501+ parent_left_type := (left_sym .info as ast.Aggregate ).sum_type
502+ left_sym = g.table.sym (parent_left_type)
503503 }
504504 right_sym := g.table.sym (node.right_type)
505- if sym .kind == .interface_ && right_sym.kind == .interface_ {
505+ if left_sym .kind == .interface_ && right_sym.kind == .interface_ {
506506 g.gen_interface_is_op (node)
507507 return
508508 }
@@ -520,7 +520,7 @@ fn (mut g Gen) infix_expr_is_op(node ast.InfixExpr) {
520520 } else {
521521 g.write ('.' )
522522 }
523- if sym .kind == .interface_ {
523+ if left_sym .kind == .interface_ {
524524 g.write ('_typ $cmp_op ' )
525525 // `_Animal_Dog_index`
526526 sub_type := match node.right {
@@ -535,9 +535,9 @@ fn (mut g Gen) infix_expr_is_op(node ast.InfixExpr) {
535535 }
536536 }
537537 sub_sym := g.table.sym (sub_type)
538- g.write ('_${sym .cname} _${sub_sym.cname} _index' )
538+ g.write ('_${left_sym .cname} _${sub_sym.cname} _index' )
539539 return
540- } else if sym .kind == .sum_type {
540+ } else if left_sym .kind == .sum_type {
541541 g.write ('_typ $cmp_op ' )
542542 }
543543 g.expr (node.right)
0 commit comments