Sema: fix wording in error message

It's an FQN, not an actual file name.
This commit is contained in:
Wooster 2024-11-09 15:31:41 +01:00 committed by Matthew Lugg
parent e5f5229fd6
commit 35201e9d93
4 changed files with 4 additions and 4 deletions

View File

@ -5511,7 +5511,7 @@ fn failWithBadMemberAccess(
else => unreachable,
};
if (agg_ty.typeDeclInst(zcu)) |inst| if ((inst.resolve(ip) orelse return error.AnalysisFail) == .main_struct_inst) {
return sema.fail(block, field_src, "root struct of file '{}' has no member named '{}'", .{
return sema.fail(block, field_src, "root source file struct '{}' has no member named '{}'", .{
agg_ty.fmt(pt), field_name.fmt(ip),
});
};

View File

@ -7,5 +7,5 @@ export fn entry() usize {
// backend=stage2
// target=native
//
// :1:29: error: root struct of file 'builtin' has no member named 'bogus'
// :1:29: error: root source file struct 'builtin' has no member named 'bogus'
// note: struct declared here

View File

@ -3,7 +3,7 @@
// target=x86_64-linux
// output_mode=Exe
//
// : error: root struct of file 'tmp' has no member named 'main'
// : error: root source file struct 'tmp' has no member named 'main'
// : note: struct declared here
// : note: called from here
// : note: called from here

View File

@ -3,4 +3,4 @@
// target=x86_64-linux,x86_64-macos
// link_libc=true
//
// :?:?: error: root struct of file 'tmp' has no member named 'main'
// :?:?: error: root source file struct 'tmp' has no member named 'main'