| ... | ... | @@ -5180,10 +5180,13 @@ fn zirExport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void |
| 5180 | 5180 | const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node }; |
| 5181 | 5181 | const options_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node }; |
| 5182 | 5182 | const decl_name = sema.code.nullTerminatedString(extra.decl_name); |
| 5183 | | if (extra.namespace != .none) { |
| 5184 | | return sema.fail(block, src, "TODO: implement exporting with field access", .{}); |
| 5185 | | } |
| 5186 | | const decl_index = try sema.lookupIdentifier(block, operand_src, decl_name); |
| 5183 | const decl_index = if (extra.namespace != .none) index_blk: { |
| 5184 | const container_ty = try sema.resolveType(block, operand_src, extra.namespace); |
| 5185 | const container_namespace = container_ty.getNamespace().?; |
| 5186 | |
| 5187 | const maybe_index = try sema.lookupInNamespace(block, operand_src, container_namespace, decl_name, false); |
| 5188 | break :index_blk maybe_index.?; // AstGen would produce error in case of unidentified name |
| 5189 | } else try sema.lookupIdentifier(block, operand_src, decl_name); |
| 5187 | 5190 | const options = sema.resolveExportOptions(block, .unneeded, extra.options) catch |err| switch (err) { |
| 5188 | 5191 | error.NeededSourceLocation => { |
| 5189 | 5192 | _ = try sema.resolveExportOptions(block, options_src, extra.options); |