Browse Source

Fix variadic parapoly bug

gingerBill 2 years ago
parent
commit
cd42d26eb3
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/check_expr.cpp

+ 5 - 5
src/check_expr.cpp

@@ -5555,11 +5555,7 @@ gb_internal CallArgumentError check_call_arguments_internal(CheckerContext *c, A
 					o.expr->Ident.token.pos = ast_token(variadic_operands[0].expr).pos;
 					o.expr->Ident.token.pos = ast_token(variadic_operands[0].expr).pos;
 
 
 					Entity *vt = pt->params->Tuple.variables[pt->variadic_index];
 					Entity *vt = pt->params->Tuple.variables[pt->variadic_index];
-					if (is_type_polymorphic(vt->type)) {
-						o.type = alloc_type_slice(default_type(variadic_operands[0].type));
-					} else {
-						o.type = vt->type;
-					}
+					o.type = vt->type;
 				} else {
 				} else {
 					dummy_argument_count += 1;
 					dummy_argument_count += 1;
 					o.type = t_untyped_nil;
 					o.type = t_untyped_nil;
@@ -5709,6 +5705,10 @@ gb_internal CallArgumentError check_call_arguments_internal(CheckerContext *c, A
 				}
 				}
 				continue;
 				continue;
 			}
 			}
+
+			if (param_is_variadic) {
+				continue;
+			}
 			score += eval_param_and_score(c, o, e->type, err, param_is_variadic, e, show_error);
 			score += eval_param_and_score(c, o, e->type, err, param_is_variadic, e, show_error);
 		}
 		}
 	}
 	}