From a23a022820d24f660b314457e1984ceb2586e109 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Sat, 5 Oct 2019 14:09:09 -0400 Subject: 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 --- src/ir.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ir.cpp') 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); -- cgit v1.2.3