From 018d9de418f2de7d2a16a8bbc45e75c38b3785b0 Mon Sep 17 00:00:00 2001 From: Turiiya Date: Tue, 19 Nov 2024 06:20:43 +0100 Subject: [PATCH] parser: optimize method parameter detection in used check --- vlib/v/parser/fn.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 7b02af8a9b8852..4e51726511480e 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -504,8 +504,7 @@ run them via `v file.v` instead', is_auto_deref: param.is_mut is_stack_obj: is_stack_obj pos: param.pos - is_used: is_pub || no_body - || (is_method && rec.type_pos == param.type_pos) || p.builtin_mod + is_used: is_pub || no_body || (is_method && k == 0) || p.builtin_mod is_arg: true ct_type_var: if (!is_method || k > 0) && param.typ.has_flag(.generic) && !param.typ.has_flag(.variadic) {