checker: minor simplification in resolve_generic_interface() (#20087)

This commit is contained in:
yuyi 2023-12-05 03:06:16 +08:00 committed by GitHub
parent 47a8051b13
commit 4b7476b49d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,12 +243,10 @@ fn (mut c Checker) resolve_generic_interface(typ ast.Type, interface_type ast.Ty
}
}
for imethod in inter_sym.info.methods {
method := typ_sym.find_method(imethod.name) or {
typ_sym.find_method_with_generic_parent(imethod.name) or {
c.error('can not find method `${imethod.name}` on `${typ_sym.name}`, needed for interface: `${inter_sym.name}`',
pos)
return 0
}
method := typ_sym.find_method_with_generic_parent(imethod.name) or {
c.error('can not find method `${imethod.name}` on `${typ_sym.name}`, needed for interface: `${inter_sym.name}`',
pos)
return 0
}
if imethod.return_type.has_flag(.generic) {
imret_sym := c.table.sym(imethod.return_type)