Commit 2209813bae

mlugg <mlugg@mlugg.co.uk>
2023-08-05 12:09:39
cases: modify error wording to match new errors
The changes to result locations and generic calls has caused mild changes to some compile errors. Some are slightly better, some slightly worse, but none of the changes are major.
1 parent 7a7d022
test/cases/compile_errors/anytype_param_requires_comptime.zig
@@ -16,7 +16,7 @@ pub export fn entry() void {
 // backend=stage2
 // target=native
 //
-// :7:14: error: runtime-known argument passed to comptime-only type parameter
+// :7:14: error: runtime-known argument passed to parameter of comptime-only type
 // :9:12: note: declared here
 // :4:16: note: struct requires comptime because of this field
 // :4:16: note: types are not available at runtime
test/cases/compile_errors/error_in_typeof_param.zig
@@ -11,4 +11,4 @@ pub export fn entry() void {
 // target=native
 //
 // :6:31: error: unable to resolve comptime value
-// :6:31: note: argument to parameter with comptime-only type must be comptime-known
+// :6:31: note: value being casted to 'comptime_int' must be comptime-known
test/cases/compile_errors/generic_method_call_with_invalid_param.zig
@@ -25,6 +25,8 @@ const S = struct {
 // target=native
 //
 // :3:18: error: expected type 'bool', found 'void'
+// :18:43: note: parameter type declared here
 // :8:18: error: expected type 'void', found 'bool'
+// :19:43: note: parameter type declared here
 // :14:26: error: runtime-known argument passed to comptime parameter
 // :20:57: note: declared comptime here
test/cases/compile_errors/invalid_store_to_comptime_field.zig
@@ -76,8 +76,9 @@ pub export fn entry8() void {
 // :19:38: error: value stored in comptime field does not match the default value of the field
 // :31:19: error: value stored in comptime field does not match the default value of the field
 // :25:29: note: default value set here
-// :41:16: error: value stored in comptime field does not match the default value of the field
+// :41:19: error: value stored in comptime field does not match the default value of the field
+// :35:29: note: default value set here
 // :45:12: error: value stored in comptime field does not match the default value of the field
-// :53:16: error: value stored in comptime field does not match the default value of the field
+// :53:25: error: value stored in comptime field does not match the default value of the field
 // :66:43: error: value stored in comptime field does not match the default value of the field
 // :59:35: error: value stored in comptime field does not match the default value of the field
test/cases/compile_errors/wrong_types_given_to_export.zig
@@ -7,5 +7,5 @@ comptime {
 // backend=stage2
 // target=native
 //
-// :3:51: error: expected type 'builtin.GlobalLinkage', found 'u32'
+// :3:21: error: expected type 'builtin.GlobalLinkage', found 'u32'
 // :?:?: note: enum declared here
test/cases/compile_errors/zero-bit_generic_args_are_coerced_to_param_type.zig
@@ -8,3 +8,4 @@ pub export fn entry() void {
 // target=native
 //
 // :3:21: error: expected type 'u0', found '*const [4:0]u8'
+// :1:23: note: parameter type declared here
test/compile_errors.zig
@@ -207,7 +207,7 @@ pub fn addCases(ctx: *Cases) !void {
             ":1:38: note: declared comptime here",
             ":8:36: error: runtime-known argument passed to comptime parameter",
             ":2:41: note: declared comptime here",
-            ":13:29: error: runtime-known argument passed to comptime-only type parameter",
+            ":13:29: error: runtime-known argument passed to parameter of comptime-only type",
             ":3:24: note: declared here",
             ":12:35: note: struct requires comptime because of this field",
             ":12:35: note: types are not available at runtime",