checker: minor cleanup in check_or_last_stmt() (#13763)

pull/13776/head
yuyi 2022-03-19 04:27:53 +08:00 committed by GitHub
parent 1734e72638
commit 3e41be1ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 33 deletions

View File

@ -1531,9 +1531,7 @@ fn (mut c Checker) check_or_last_stmt(stmt ast.Stmt, ret_type ast.Type, expr_ret
stmt.pos)
}
}
} else {
match stmt {
ast.ExprStmt {
} else if stmt is ast.ExprStmt {
match stmt.expr {
ast.IfExpr {
for branch in stmt.expr.branches {
@ -1565,9 +1563,6 @@ fn (mut c Checker) check_or_last_stmt(stmt ast.Stmt, ret_type ast.Type, expr_ret
}
}
}
else {}
}
}
}
pub fn (mut c Checker) selector_expr(mut node ast.SelectorExpr) ast.Type {