Fix matches list
This commit is contained in:
@@ -356,7 +356,7 @@ Ast_Decl *get_or_instantiate_polymorph_lambda(Token *pos, Ast_Decl *poly, Array<
|
|||||||
result = (Ast_Decl *)ast_copy(poly, poly->parent_scope, &poly->polymorph_parameters, ¶ms);
|
result = (Ast_Decl *)ast_copy(poly, poly->parent_scope, &poly->polymorph_parameters, ¶ms);
|
||||||
For(result->lambda->args) {
|
For(result->lambda->args) {
|
||||||
if (it->flags & AST_IDENT_POLYMORPH) {
|
if (it->flags & AST_IDENT_POLYMORPH) {
|
||||||
result->lambda->args.ordered_remove(it);
|
result->lambda->args.ordered_remove(it); //@verify: this does not fuck ordereding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1699,7 +1699,7 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_and_const_str
|
|||||||
For(matches) {
|
For(matches) {
|
||||||
if (it.lambda_arg->flags & AST_POLYMORPH) {
|
if (it.lambda_arg->flags & AST_POLYMORPH) {
|
||||||
replacements.add(it.call_arg);
|
replacements.add(it.call_arg);
|
||||||
matches.ordered_remove(it);
|
matches.ordered_remove(it); //@verify: this does not fuck ordereding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1710,7 +1710,13 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_and_const_str
|
|||||||
|
|
||||||
// We know need to fix the matches list CAUSE ITS FUCKED
|
// We know need to fix the matches list CAUSE ITS FUCKED
|
||||||
// Thanks polymorphism
|
// Thanks polymorphism
|
||||||
For(matches) {
|
For_Named(matches, match_it) {
|
||||||
|
For_Named(lambda->args, lambda_it) {
|
||||||
|
if (match_it.lambda_arg->name == lambda_it->name) {
|
||||||
|
match_it.lambda_arg = lambda_it;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user