Fix Compiler assertion when applying using to _ procedure parameter. #451

This commit is contained in:
gingerBill
2019-10-26 12:14:04 +01:00
parent 2c75fe2314
commit 94879ed149
4 changed files with 8 additions and 9 deletions

View File

@@ -221,12 +221,13 @@ Entity *alloc_entity_variable(Scope *scope, Token token, Type *type, bool is_imm
return entity;
}
Entity *alloc_entity_using_variable(Entity *parent, Token token, Type *type) {
Entity *alloc_entity_using_variable(Entity *parent, Token token, Type *type, Ast *using_expr) {
GB_ASSERT(parent != nullptr);
token.pos = parent->token.pos;
Entity *entity = alloc_entity(Entity_Variable, parent->scope, token, type);
entity->using_parent = parent;
entity->parent_proc_decl = parent->parent_proc_decl;
entity->using_expr = using_expr;
entity->flags |= EntityFlag_Using;
entity->flags |= EntityFlag_Used;
entity->state = EntityState_Resolved;