diff options
| author | gingerBill <bill@gingerbill.org> | 2018-09-29 13:07:46 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-09-29 13:07:46 +0100 |
| commit | 834308d8ceeeae14102b5afc1e5a05995e45f46d (patch) | |
| tree | 5af8f321a3a549963e6502d16f6cb04be4919c72 /src/check_decl.cpp | |
| parent | 1a18481d8ba01e844f9d16479c6de0d06157e685 (diff) | |
Fix `using import` override "bug"
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 4267a65fd..de0aa572d 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -299,7 +299,16 @@ void override_entity_in_scope(Entity *original_entity, Entity *new_entity) { Scope *found_scope = nullptr; Entity *found_entity = nullptr; scope_lookup_parent(original_entity->scope, original_name, &found_scope, &found_entity); - GB_ASSERT(found_entity == original_entity); + + // IMPORTANT TODO(bill) + // Date: 2018-09-29 + // This assert fails on `using import` if the name of the alias is the same. What should be the expected behaviour? + // Namespace collision or override? Overridding is the current behaviour + // + // using import "foo" + // bar :: foo.bar; + + // GB_ASSERT_MSG(found_entity == original_entity, "%.*s == %.*s", LIT(found_entity->token.string), LIT(new_entity->token.string)); map_set(&found_scope->elements, hash_string(original_name), new_entity); } |