ast: cleanup in find_method_with_generic_parent() (#13600)

pull/13606/head
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
1 changed files with 1 additions and 2 deletions

View File

@ -1267,7 +1267,7 @@ pub fn (t &TypeSymbol) find_method_with_generic_parent(name string) ?Fn {
mut method := x mut method := x
generic_names := parent_sym.info.generic_types.map(table.sym(it).name) generic_names := parent_sym.info.generic_types.map(table.sym(it).name)
return_sym := table.sym(method.return_type) 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, method.return_type = table.unwrap_generic_type(method.return_type,
generic_names, t.info.concrete_types) generic_names, t.info.concrete_types)
} else { } else {
@ -1290,7 +1290,6 @@ pub fn (t &TypeSymbol) find_method_with_generic_parent(name string) ?Fn {
} }
else {} else {}
} }
} else {
} }
} }
} }