aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-26 23:12:55 +0100
committergingerBill <bill@gingerbill.org>2018-05-26 23:12:55 +0100
commitc067b90403ab8493daa0bf5867b2bd92319feea5 (patch)
treef8d8162cc7d0e937c925ed8b07831ffc0e9c75de /src/check_expr.cpp
parent5b6770f3d297c0639bdbe8b1b029616c16669165 (diff)
Add basic package support (no IR support yet)
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index ab9a42e6f..34337ce0e 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -109,7 +109,7 @@ void error_operand_no_value(Operand *o) {
void check_scope_decls(Checker *c, Array<AstNode *> nodes, isize reserve_size) {
Scope *s = c->context.scope;
- GB_ASSERT(s->file == nullptr);
+ GB_ASSERT(s->package == nullptr);
check_collect_entities(c, nodes);
@@ -342,17 +342,18 @@ bool find_or_generate_polymorphic_procedure(Checker *c, Entity *base_entity, Typ
// NOTE(bill): Set the scope afterwards as this is not real overloading
entity->scope = scope->parent;
- AstFile *file = nullptr;
+ AstPackage *package = nullptr;
{
Scope *s = entity->scope;
- while (s != nullptr && s->file == nullptr) {
- file = s->file;
+ while (s != nullptr && s->package == nullptr) {
+ package = s->package;
s = s->parent;
}
}
ProcedureInfo proc_info = {};
- proc_info.file = file;
+ // proc_info.file = file;
+ proc_info.package = package;
proc_info.token = token;
proc_info.decl = d;
proc_info.type = final_proc_type;
@@ -5362,7 +5363,7 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
return kind;
}
- check_procedure_later(c, c->curr_ast_file, empty_token, decl, type, pl->body, pl->tags);
+ check_procedure_later(c, c->curr_ast_package, empty_token, decl, type, pl->body, pl->tags);
}
check_close_scope(c);