aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-01-01 15:11:54 +0000
committergingerBill <bill@gingerbill.org>2019-01-01 15:11:54 +0000
commit0778d18bc7ec7990ac521ed71130f7f26a6907d3 (patch)
tree51e80755346e0988e9fe33bdb46f9231ebea50e8 /src/check_type.cpp
parentd7e9b8d374120023fa5d87248e9fb905e9f62d85 (diff)
Fix `using` with `bit_field`
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp4
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);