@@ -1530,7 +1530,7 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
15301530 if i == args_len - 1 {
15311531 c.check_variadic_arg (call_arg.expr, typ, expected_type, param.typ, i + 1 ,
15321532 func.name, func.is_method, func.is_variadic , args_len == 1 && i == 0 ,
1533- node.pos, call_arg.pos)
1533+ func.generic_names.len > 0 , node.pos, call_arg.pos)
15341534 }
15351535 } else {
15361536 c.expected_type = param.typ
@@ -2542,8 +2542,8 @@ fn (mut c Checker) method_call(mut node ast.CallExpr, mut continue_check &bool)
25422542 typ := c.expr (mut arg.expr)
25432543 if i == node.args.len - 1 {
25442544 c.check_variadic_arg (arg.expr, typ, expected_type, param.typ, i + 1 , method.name,
2545- true , method.is_variadic, node.args.len == 1 && i == 0 , node.pos ,
2546- arg.pos)
2545+ true , method.is_variadic, node.args.len == 1 && i == 0 , method.generic_names.len > 0 ,
2546+ node.pos, arg.pos)
25472547 }
25482548 } else {
25492549 c.expected_type = param.typ
@@ -3980,11 +3980,11 @@ fn (mut c Checker) has_veb_context(typ ast.Type) bool {
39803980
39813981fn (mut c Checker) check_variadic_arg (arg_expr ast.Expr, typ ast.Type, expected_type ast.Type, param_typ ast.Type,
39823982 arg_num int , fn_name string , is_method bool , fn_is_variadic bool , is_single_array_arg bool ,
3983- call_pos token.Pos, arg_pos token.Pos) {
3983+ is_generic_fn bool , call_pos token.Pos, arg_pos token.Pos) {
39843984 kind := c.table.sym (typ).kind
39853985 is_decompose := arg_expr is ast.ArrayDecompose
39863986 mut allow_variadic_pass := false
3987- if arg_expr is ast.Ident && ! is_method {
3987+ if arg_expr is ast.Ident && ! ( is_method && is_generic_fn) {
39883988 ident := arg_expr as ast.Ident
39893989 if ident.obj is ast.Var {
39903990 var_obj := ident.obj as ast.Var
0 commit comments