Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 31, 2024
1 parent 26b8a88 commit fe95055
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/checker/infix.v
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,9 @@ fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type {
}
// sum types can't have any infix operation except of `is`, `eq`, `ne`.
// `is` is checked before and doesn't reach this.
if left_sym.kind == .sum_type && !eq_ne {
if c.table.type_kind(left_type) == .sum_type && !eq_ne {
c.error('cannot use operator `${node.op}` with `${left_sym.name}`', node.pos)
} else if right_sym.kind == .sum_type && !eq_ne {
} else if c.table.type_kind(right_type) == .sum_type && !eq_ne {
c.error('cannot use operator `${node.op}` with `${right_sym.name}`', node.pos)
}
// TODO: move this to symmetric_check? Right now it would break `return 0` for `fn()?int `
Expand Down

0 comments on commit fe95055

Please sign in to comment.