diff options
| author | gingerBill <bill@gingerbill.org> | 2018-07-29 11:29:20 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-07-29 11:29:20 +0100 |
| commit | 96fc9138d4e238512896a00d59d3f1dca76e5df1 (patch) | |
| tree | 57a9969f4f9e61110ce051f097b8e4704f37d0b1 /src/check_type.cpp | |
| parent | 6512a3e5f24a3aecb1451f921455a93231412104 (diff) | |
Do `using Foo :: enum` at the `type_decl` stage
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 4f44e0c4d..77b370619 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -600,29 +600,7 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast GB_ASSERT(fields.count <= et->fields.count); - enum_type->Enum.fields = fields; - enum_type->Enum.is_using = et->is_using; - // TODO(bill): Should this be done elsewhere? e.g. delayed - if (et->is_using) { - Scope *parent = ctx->scope->parent; - if (parent->flags&ScopeFlag_File) { - // NOTE(bill): Use package scope - parent = parent->parent; - } - for_array(i, fields) { - Entity *f = fields[i]; - if (f->kind != Entity_Constant) { - continue; - } - String name = f->token.string; - if (is_blank_ident(name)) { - continue; - } - add_entity(ctx->checker, parent, nullptr, f); - } - } - - Scope *s = ctx->scope; + enum_type->Enum.fields = fields; enum_type->Enum.names = make_names_field_for_struct(ctx, ctx->scope); } |