From 0c710ce470ba143053228bc5a3aa107108207a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kr=C3=BCger?= <45282134+UweKrueger@users.noreply.github.com> Date: Fri, 9 Apr 2021 17:18:02 +0200 Subject: [PATCH] cgen: register `Option_void` when used for `chan <- x or {...}` (#9648) --- vlib/v/gen/c/cgen.v | 1 + 1 file changed, 1 insertion(+) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 9019b30096..3459a762b0 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -670,6 +670,7 @@ static inline $opt_el_type __Option_${styp}_popval($styp ch) { fn (mut g Gen) register_chan_push_optional_call(el_type string, styp string) { if styp !in g.chan_push_optionals { g.chan_push_optionals << styp + g.register_optional(ast.void_type.set_flag(.optional)) g.channel_definitions.writeln(' static inline Option_void __Option_${styp}_pushval($styp ch, $el_type e) { if (sync__Channel_try_push_priv(ch, &e, false)) {