aboutsummaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/cases/aarch64-macos/hello_world_with_updates.0.zig3
-rw-r--r--test/cases/compile_errors/bogus_compile_var.zig3
-rw-r--r--test/cases/compile_errors/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig2
-rw-r--r--test/cases/x86_64-linux/hello_world_with_updates.0.zig3
-rw-r--r--test/cases/x86_64-macos/hello_world_with_updates.0.zig3
-rw-r--r--test/cases/x86_64-windows/hello_world_with_updates.0.zig3
6 files changed, 6 insertions, 11 deletions
diff --git a/test/cases/aarch64-macos/hello_world_with_updates.0.zig b/test/cases/aarch64-macos/hello_world_with_updates.0.zig
index 3c7a494180..9f516ff139 100644
--- a/test/cases/aarch64-macos/hello_world_with_updates.0.zig
+++ b/test/cases/aarch64-macos/hello_world_with_updates.0.zig
@@ -2,5 +2,4 @@
// output_mode=Exe
// target=aarch64-macos
//
-// :109:9: error: struct 'tmp.tmp' has no member named 'main'
-// :7:1: note: struct declared here
+// :109:9: error: root struct of file 'tmp' has no member named 'main'
diff --git a/test/cases/compile_errors/bogus_compile_var.zig b/test/cases/compile_errors/bogus_compile_var.zig
index b675fd941c..be222e5393 100644
--- a/test/cases/compile_errors/bogus_compile_var.zig
+++ b/test/cases/compile_errors/bogus_compile_var.zig
@@ -5,5 +5,4 @@ export fn entry() usize { return @sizeOf(@TypeOf(x)); }
// backend=stage2
// target=native
//
-// :1:29: error: struct 'builtin.builtin' has no member named 'bogus'
-// :1:1: note: struct declared here
+// :1:29: error: root struct of file 'builtin' has no member named 'bogus'
diff --git a/test/cases/compile_errors/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig b/test/cases/compile_errors/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig
index 9ae320650a..d78891bb2b 100644
--- a/test/cases/compile_errors/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig
+++ b/test/cases/compile_errors/issue_2032_compile_diagnostic_string_for_top_level_decl_type.zig
@@ -7,5 +7,5 @@ export fn entry() void {
// backend=stage2
// target=native
//
-// :2:27: error: expected type 'u32', found 'tmp.tmp'
+// :2:27: error: expected type 'u32', found 'tmp'
// :1:1: note: struct declared here
diff --git a/test/cases/x86_64-linux/hello_world_with_updates.0.zig b/test/cases/x86_64-linux/hello_world_with_updates.0.zig
index c9c94442d0..40abdd6c1f 100644
--- a/test/cases/x86_64-linux/hello_world_with_updates.0.zig
+++ b/test/cases/x86_64-linux/hello_world_with_updates.0.zig
@@ -2,5 +2,4 @@
// output_mode=Exe
// target=x86_64-linux
//
-// :109:9: error: struct 'tmp.tmp' has no member named 'main'
-// :7:1: note: struct declared here
+// :109:9: error: root struct of file 'tmp' has no member named 'main'
diff --git a/test/cases/x86_64-macos/hello_world_with_updates.0.zig b/test/cases/x86_64-macos/hello_world_with_updates.0.zig
index 5860c9c0f6..e0680c81d7 100644
--- a/test/cases/x86_64-macos/hello_world_with_updates.0.zig
+++ b/test/cases/x86_64-macos/hello_world_with_updates.0.zig
@@ -2,5 +2,4 @@
// output_mode=Exe
// target=x86_64-macos
//
-// :109:9: error: struct 'tmp.tmp' has no member named 'main'
-// :7:1: note: struct declared here
+// :109:9: error: root struct of file 'tmp' has no member named 'main'
diff --git a/test/cases/x86_64-windows/hello_world_with_updates.0.zig b/test/cases/x86_64-windows/hello_world_with_updates.0.zig
index 142699b9da..04e1d4cfad 100644
--- a/test/cases/x86_64-windows/hello_world_with_updates.0.zig
+++ b/test/cases/x86_64-windows/hello_world_with_updates.0.zig
@@ -2,5 +2,4 @@
// output_mode=Exe
// target=x86_64-windows
//
-// :130:9: error: struct 'tmp.tmp' has no member named 'main'
-// :7:1: note: struct declared here
+// :130:9: error: root struct of file 'tmp' has no member named 'main'