Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 20, 2025
1 parent 6a40750 commit a391c16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/v/checker/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr, mut continue_check &bool)
left_type.has_flag(.generic)
}
mut rec_concrete_types := []ast.Type{}
method_generic_names_len := method.generic_names.len
mut method_generic_names_len := method.generic_names.len
match rec_sym.info {
ast.Struct, ast.SumType, ast.Interface {
if rec_sym.info.concrete_types.len > 0 {
Expand Down Expand Up @@ -2608,6 +2608,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr, mut continue_check &bool)
if left_sym.kind == .interface && is_method_from_embed && method.return_type.has_flag(.generic)
&& method_generic_names_len == 0 {
method.generic_names = c.table.get_generic_names((rec_sym.info as ast.Interface).generic_types)
method_generic_names_len = method.generic_names.len
}
if method_generic_names_len != node.concrete_types.len {
// no type arguments given in call, attempt implicit instantiation
Expand Down

0 comments on commit a391c16

Please sign in to comment.