1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast: cleanup in find_method_with_generic_parent() (#13600)

This commit is contained in:
yuyi 2022-02-26 07:11:56 +08:00 committed by GitHub
parent d80f5165dd
commit 0d9792bdf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
}
}
}