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.
This commit is contained in:
Veikka Tuominen
2022-09-29 17:45:27 +03:00
parent 409cf4aeb8
commit b3c6d774d2
8 changed files with 12 additions and 11 deletions

View File

@@ -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);