aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-09-29 17:45:27 +0300
committerVeikka Tuominen <git@vexu.eu>2022-09-30 00:09:24 +0300
commitb3c6d774d292e6e4ddf4cd54455c4ef3c6386d66 (patch)
tree782ba20f4fa00b095b1aec1db866833947b53882 /src/Module.zig
parent409cf4aeb826d8f7c35f0aa10bb0a8fe45188555 (diff)
downloadzig-b3c6d774d292e6e4ddf4cd54455c4ef3c6386d66.tar.gz
zig-b3c6d774d292e6e4ddf4cd54455c4ef3c6386d66.zip
stage2: improve error message for missing member in file root struct
* the root struct decl name is fully qualified this prevents error messages containing 'main.main' * avoid declared here note when file struct is missing a member It always points at the start of the file which might contain another container misleading the user.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig
index e756cc3dfd..6056c385e3 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -4435,6 +4435,7 @@ pub fn semaFile(mod: *Module, file: *File) SemaError!void {
new_decl.alive = true; // This Decl corresponds to a File and is therefore always alive.
new_decl.analysis = .in_progress;
new_decl.generation = mod.generation;
+ new_decl.name_fully_qualified = true;
if (file.status == .success_zir) {
assert(file.zir_loaded);