diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-04 12:32:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-04 12:32:22 -0700 |
| commit | 230ce72f168d5bcd0feb2f8f0aed42ea6ad27b09 (patch) | |
| tree | c2ef5066bbbc28cdaca073e745d73d32773f6ede /src/Module.zig | |
| parent | 3dafec0acd01c9e044ed9c81dd4f34f30018b065 (diff) | |
| download | zig-230ce72f168d5bcd0feb2f8f0aed42ea6ad27b09.tar.gz zig-230ce72f168d5bcd0feb2f8f0aed42ea6ad27b09.zip | |
stage2: fix "other symbol here" error note
It wasn't setting the source location properly.
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 15 |
1 files changed, 7 insertions, 8 deletions
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; |
