From 09c9cbcef9b4eb64407d06c638fa8f00b68784ee Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 10 Mar 2023 17:30:46 +0800 Subject: [PATCH] cgen: fix assign option value using propagate option (#17578) --- vlib/v/gen/c/assign.v | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vlib/v/gen/c/assign.v b/vlib/v/gen/c/assign.v index 023c283be6..5c0fef11a5 100644 --- a/vlib/v/gen/c/assign.v +++ b/vlib/v/gen/c/assign.v @@ -16,9 +16,7 @@ fn (mut g Gen) expr_with_opt_or_block(expr ast.Expr, expr_typ ast.Type, var_expr g.writeln(';') g.writeln('if (${expr}.state != 0) {') if expr is ast.Ident && (expr as ast.Ident).or_expr.kind == .propagate_option { - g.write('return ') - g.gen_option_error(g.cur_fn.return_type, expr) - g.writeln(';') + g.writeln('\tpanic_option_not_set(_SLIT("none"));') } else { g.inside_or_block = true defer {