diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2019-10-05 14:09:09 -0400 |
|---|---|---|
| committer | Michael Dusan <michael.dusan@gmail.com> | 2019-10-05 14:09:09 -0400 |
| commit | a23a022820d24f660b314457e1984ceb2586e109 (patch) | |
| tree | 5de4e8092445464ef9fe23ecac3af2cc6f94dbd0 /src/ir.cpp | |
| parent | a7c9aa7ddb06fe14c4c67e317586177141c9e37a (diff) | |
| download | zig-a23a022820d24f660b314457e1984ceb2586e109.tar.gz zig-a23a022820d24f660b314457e1984ceb2586e109.zip | |
fix container member access for fn/struct-fn
- decls brought in via `usingnamespace` were not always found
because lookup was performed directly against decl_table and
use_decls was never consulted
- fix to use find_container_decl() path instead
- closes #3367
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 14adf6fbd6..52b59ddcad 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17673,8 +17673,7 @@ static IrInstruction *ir_analyze_container_member_access_inner(IrAnalyze *ira, if (!is_slice(bare_struct_type)) { ScopeDecls *container_scope = get_container_scope(bare_struct_type); assert(container_scope != nullptr); - auto entry = container_scope->decl_table.maybe_get(field_name); - Tld *tld = entry ? entry->value : nullptr; + auto tld = find_container_decl(ira->codegen, container_scope, field_name); if (tld) { if (tld->id == TldIdFn) { resolve_top_level_decl(ira->codegen, tld, source_instr->source_node, false); |
