From 573c99a4f2d3342224df1bbd1758c8b37ac4004e Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 12 Nov 2024 00:20:22 -0300 Subject: [PATCH] fix --- vlib/v/checker/checker.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index eed84968d3c2c4..b9402f71258fc0 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1354,7 +1354,8 @@ fn (mut c Checker) check_or_expr(node ast.OrExpr, ret_type ast.Type, expr_return return } if node.stmts.len == 0 { - if expr is ast.CallExpr && expr.is_return_used && ret_type != ast.void_type { + if expr is ast.CallExpr && expr.is_return_used + && ret_type.clear_option_and_result() != ast.void_type { // x := f() or {} c.error('assignment requires a non empty `or {}` block', node.pos) }