Skip to content

Commit

Permalink
disallow only for empty return types
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 committed Apr 14, 2024
1 parent 67e4346 commit f230820
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions vlib/v/checker/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -2745,9 +2745,6 @@ fn (mut c Checker) check_map_and_filter(is_map bool, elem_typ ast.Type, node ast
if arg_expr.return_type.has_flag(.result) && arg_expr.or_block.kind != .block {
if arg_expr.return_type.clear_option_and_result() in [ast.void_type, 0] {
c.error('cannot use Result type in `${node.name}`', arg_expr.pos)
} else {
c.error('cannot use Result type in `${node.name}` calls without unwrapping or using an or block',
arg_expr.pos)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/sessions/db_store.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn (mut store DBStore[T]) all() ![]T {
}!

// decode should never fail
return rows.map(json.decode(T, it.data) or { T{} })
return rows.map(json.decode(T, it.data)!)
}

// get session for session id `sid`. The session can be `max_age` old.
Expand Down

0 comments on commit f230820

Please sign in to comment.