diff options
| author | gingerBill <bill@gingerbill.org> | 2019-01-01 15:11:54 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-01-01 15:11:54 +0000 |
| commit | 0778d18bc7ec7990ac521ed71130f7f26a6907d3 (patch) | |
| tree | 51e80755346e0988e9fe33bdb46f9231ebea50e8 /src/check_type.cpp | |
| parent | d7e9b8d374120023fa5d87248e9fb905e9f62d85 (diff) | |
Fix `using` with `bit_field`
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 7324e92ca..1acf379a7 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -40,7 +40,7 @@ void populate_using_entity_scope(CheckerContext *ctx, Ast *node, AstField *field GB_ASSERT(f->kind == Entity_Variable); String name = f->token.string; Entity *e = scope_lookup_current(ctx->scope, name); - if (e != nullptr && name != "_") { + if (e != nullptr && name != "_" && e != f) { // TODO(bill): Better type error if (str != nullptr) { error(e->token, "'%.*s' is already declared in '%s'", LIT(name), str); @@ -59,7 +59,7 @@ void populate_using_entity_scope(CheckerContext *ctx, Ast *node, AstField *field Entity *f = t->BitField.fields[i]; String name = f->token.string; Entity *e = scope_lookup_current(ctx->scope, name); - if (e != nullptr && name != "_") { + if (e != nullptr && name != "_" && e != f) { // TODO(bill): Better type error if (str != nullptr) { error(e->token, "'%.*s' is already declared in '%s'", LIT(name), str); |