Skip to content

Commit c67891d

Browse files
authored
checker: minor cleanup in match_expr() (#10261)
1 parent ba86d61 commit c67891d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

vlib/v/checker/checker.v

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5330,11 +5330,7 @@ pub fn (mut c Checker) match_expr(mut node ast.MatchExpr) ast.Type {
53305330
c.ensure_type_exists(node.cond_type, node.pos) or { return ast.void_type }
53315331
c.check_expr_opt_call(node.cond, cond_type)
53325332
cond_type_sym := c.table.get_type_symbol(cond_type)
5333-
if cond_type_sym.kind !in [.interface_, .sum_type] {
5334-
node.is_sum_type = false
5335-
} else {
5336-
node.is_sum_type = true
5337-
}
5333+
node.is_sum_type = cond_type_sym.kind in [.interface_, .sum_type]
53385334
c.match_exprs(mut node, cond_type_sym)
53395335
c.expected_type = cond_type
53405336
mut ret_type := ast.void_type

0 commit comments

Comments
 (0)