diff options
| author | gingerBill <bill@gingerbill.org> | 2022-09-12 13:08:32 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-09-12 13:08:32 +0100 |
| commit | ef372bd86194a01f6386fd1eae71e7362e28cf89 (patch) | |
| tree | f418c4493ab2d0d23c12f05c47bf5e53ce7d7126 /src/checker.cpp | |
| parent | fbbfe438dc8d841bdba6585c7b80336b569a01f0 (diff) | |
Replace `#optional_second` with `#optional_allocator_error`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 16e480786..cdc0630bf 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -2809,17 +2809,9 @@ void init_mem_allocator(Checker *c) { if (t_allocator != nullptr) { return; } - AstPackage *pkg = get_core_package(&c->info, str_lit("runtime")); - - String name = str_lit("Allocator"); - Entity *e = scope_lookup_current(pkg->scope, name); - if (e == nullptr) { - compiler_error("Could not find type declaration for '%.*s'\n", LIT(name)); - // NOTE(bill): This will exit the program as it's cannot continue without it! - } - - t_allocator = e->type; + t_allocator = find_core_type(c, str_lit("Allocator")); t_allocator_ptr = alloc_type_pointer(t_allocator); + t_allocator_error = find_core_type(c, str_lit("Allocator_Error")); } void init_core_context(Checker *c) { @@ -2827,7 +2819,6 @@ void init_core_context(Checker *c) { return; } t_context = find_core_type(c, str_lit("Context")); - GB_ASSERT(t_context != nullptr); t_context_ptr = alloc_type_pointer(t_context); } |