1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: vfmt checker.v

This commit is contained in:
Alexander Medvednikov 2022-05-23 00:12:37 +03:00
parent 5e95bdc451
commit 863eeca2e0

View File

@ -941,7 +941,8 @@ pub fn (mut c Checker) check_or_expr(node ast.OrExpr, ret_type ast.Type, expr_re
} }
if !expr_return_type.has_flag(.optional) { if !expr_return_type.has_flag(.optional) {
if expr_return_type.has_flag(.result) { if expr_return_type.has_flag(.result) {
c.warn('propagating a result like an option is deprecated, use `foo()!` instead of `foo()?`', node.pos) c.warn('propagating a result like an option is deprecated, use `foo()!` instead of `foo()?`',
node.pos)
} else { } else {
c.error('to propagate an option, the call must also return an optional type', c.error('to propagate an option, the call must also return an optional type',
node.pos) node.pos)