authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-04 12:32:22-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-04 12:32:22-07:00
log230ce72f168d5bcd0feb2f8f0aed42ea6ad27b09
treec2ef5066bbbc28cdaca073e745d73d32773f6ede
parent3dafec0acd01c9e044ed9c81dd4f34f30018b065

stage2: fix "other symbol here" error note

It wasn't setting the source location properly.

1 files changed, 7 insertions(+), 8 deletions(-)

src/Module.zig+7-8
......@@ -667,7 +667,7 @@ pub const Scope = struct {
667667 return switch (scope.tag) {
668668 .block => scope.cast(Block).?.src_decl,
669669 .file => null,
670 .namespace => null,
670 .namespace => scope.cast(Namespace).?.getDecl(),
671671 .decl_ref => scope.cast(DeclRef).?.decl,
672672 };
673673 }
......@@ -3331,13 +3331,12 @@ pub fn analyzeExport(
33313331 .{symbol_name},
33323332 );
33333333 errdefer msg.destroy(mod.gpa);
3334 try mod.errNote(
3335 &other_export.owner_decl.namespace.base,
3336 other_export.src,
3337 msg,
3338 "other symbol here",
3339 .{},
3340 );
3334 const other_src_loc: SrcLoc = .{
3335 .file_scope = other_export.owner_decl.namespace.file_scope,
3336 .parent_decl_node = other_export.owner_decl.src_node,
3337 .lazy = other_export.src,
3338 };
3339 try mod.errNoteNonLazy(other_src_loc, msg, "other symbol here", .{});
33413340 mod.failed_exports.putAssumeCapacityNoClobber(new_export, msg);
33423341 new_export.status = .failed;
33433342 return;