From 230ce72f168d5bcd0feb2f8f0aed42ea6ad27b09 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 4 May 2021 12:32:22 -0700 Subject: stage2: fix "other symbol here" error note It wasn't setting the source location properly. --- src/Module.zig | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Module.zig b/src/Module.zig index eb569dec2b..4b421241cd 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -667,7 +667,7 @@ pub const Scope = struct { return switch (scope.tag) { .block => scope.cast(Block).?.src_decl, .file => null, - .namespace => null, + .namespace => scope.cast(Namespace).?.getDecl(), .decl_ref => scope.cast(DeclRef).?.decl, }; } @@ -3331,13 +3331,12 @@ pub fn analyzeExport( .{symbol_name}, ); errdefer msg.destroy(mod.gpa); - try mod.errNote( - &other_export.owner_decl.namespace.base, - other_export.src, - msg, - "other symbol here", - .{}, - ); + const other_src_loc: SrcLoc = .{ + .file_scope = other_export.owner_decl.namespace.file_scope, + .parent_decl_node = other_export.owner_decl.src_node, + .lazy = other_export.src, + }; + try mod.errNoteNonLazy(other_src_loc, msg, "other symbol here", .{}); mod.failed_exports.putAssumeCapacityNoClobber(new_export, msg); new_export.status = .failed; return; -- cgit v1.2.3