From 0d9792bdf2ec1cfbb8853398efea437e5d48e509 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sat, 26 Feb 2022 07:11:56 +0800 Subject: [PATCH] ast: cleanup in find_method_with_generic_parent() (#13600) --- vlib/v/ast/types.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vlib/v/ast/types.v b/vlib/v/ast/types.v index 11e9d3938a..265354821c 100644 --- a/vlib/v/ast/types.v +++ b/vlib/v/ast/types.v @@ -1267,7 +1267,7 @@ pub fn (t &TypeSymbol) find_method_with_generic_parent(name string) ?Fn { mut method := x generic_names := parent_sym.info.generic_types.map(table.sym(it).name) return_sym := table.sym(method.return_type) - if return_sym.kind == .struct_ { + if return_sym.kind in [.struct_, .interface_, .sum_type] { method.return_type = table.unwrap_generic_type(method.return_type, generic_names, t.info.concrete_types) } else { @@ -1290,7 +1290,6 @@ pub fn (t &TypeSymbol) find_method_with_generic_parent(name string) ?Fn { } else {} } - } else { } } }