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 {...@@ -667,7 +667,7 @@ pub const Scope = struct {
667 return switch (scope.tag) {667 return switch (scope.tag) {
668 .block => scope.cast(Block).?.src_decl,668 .block => scope.cast(Block).?.src_decl,
669 .file => null,669 .file => null,
670 .namespace => null,670 .namespace => scope.cast(Namespace).?.getDecl(),
671 .decl_ref => scope.cast(DeclRef).?.decl,671 .decl_ref => scope.cast(DeclRef).?.decl,
672 };672 };
673 }673 }
...@@ -3331,13 +3331,12 @@ pub fn analyzeExport(...@@ -3331,13 +3331,12 @@ pub fn analyzeExport(
3331 .{symbol_name},3331 .{symbol_name},
3332 );3332 );
3333 errdefer msg.destroy(mod.gpa);3333 errdefer msg.destroy(mod.gpa);
3334 try mod.errNote(3334 const other_src_loc: SrcLoc = .{
3335 &other_export.owner_decl.namespace.base,3335 .file_scope = other_export.owner_decl.namespace.file_scope,
3336 other_export.src,3336 .parent_decl_node = other_export.owner_decl.src_node,
3337 msg,3337 .lazy = other_export.src,
3338 "other symbol here",3338 };
3339 .{},3339 try mod.errNoteNonLazy(other_src_loc, msg, "other symbol here", .{});
3340 );
3341 mod.failed_exports.putAssumeCapacityNoClobber(new_export, msg);3340 mod.failed_exports.putAssumeCapacityNoClobber(new_export, msg);
3342 new_export.status = .failed;3341 new_export.status = .failed;
3343 return;3342 return;