From bdf4c679da119d317e7aba977606cb69bb9e48ee Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 28 Sep 2022 01:05:04 +0800 Subject: [PATCH] cgen: minor cleanup in method_call() (#15894) --- vlib/v/gen/c/fn.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/gen/c/fn.v b/vlib/v/gen/c/fn.v index 675cfd3d4a..d6cc4f08d3 100644 --- a/vlib/v/gen/c/fn.v +++ b/vlib/v/gen/c/fn.v @@ -715,7 +715,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) { } left_type := g.unwrap_generic(node.left_type) mut unwrapped_rec_type := node.receiver_type - if unsafe { g.cur_fn != 0 } && g.cur_fn.generic_names.len > 0 { // in generic fn + if g.cur_fn != unsafe { nil } && g.cur_fn.generic_names.len > 0 { // in generic fn unwrapped_rec_type = g.unwrap_generic(node.receiver_type) } else { // in non-generic fn sym := g.table.sym(node.receiver_type)