Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 12, 2024
1 parent 1aac146 commit 0467c17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,9 @@ fn (mut c Checker) check_or_expr(node ast.OrExpr, ret_type ast.Type, expr_return
if expr is ast.CallExpr && expr.is_return_used {
// x := f() or {}, || f() or {} etc
c.error('expression requires a non empty `or {}` block', node.pos)
} else if expr !is ast.CallExpr && ret_type != ast.void_type {
// _ := sql db {... } or { }
c.error('expression requires a non empty `or {}` block', node.pos)
}
// allow `f() or {}`
return
Expand Down

0 comments on commit 0467c17

Please sign in to comment.