diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-11-11 07:27:31 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2023-11-19 09:56:51 +0000 |
| commit | 21fa187abc2a06c9bd5cfe4355c5edbfb3177f6b (patch) | |
| tree | aab7cc16498184bac0fd8b6d5443f7bd606e7bf8 /test/cases/compile_errors/invalid_compare_string.zig | |
| parent | 2c1acb618027939c0812bc87a432b51632127717 (diff) | |
| download | zig-21fa187abc2a06c9bd5cfe4355c5edbfb3177f6b.tar.gz zig-21fa187abc2a06c9bd5cfe4355c5edbfb3177f6b.zip | |
test: update cases to silence 'var is never mutated' errors
Diffstat (limited to 'test/cases/compile_errors/invalid_compare_string.zig')
| -rw-r--r-- | test/cases/compile_errors/invalid_compare_string.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/cases/compile_errors/invalid_compare_string.zig b/test/cases/compile_errors/invalid_compare_string.zig index a5c7f041a5..95f6fa4122 100644 --- a/test/cases/compile_errors/invalid_compare_string.zig +++ b/test/cases/compile_errors/invalid_compare_string.zig @@ -1,20 +1,20 @@ comptime { - var a = "foo"; + const a = "foo"; if (a == "foo") unreachable; } comptime { - var a = "foo"; + const a = "foo"; if (a == ("foo")) unreachable; // intentionally allow } comptime { - var a = "foo"; + const a = "foo"; switch (a) { "foo" => unreachable, else => {}, } } comptime { - var a = "foo"; + const a = "foo"; switch (a) { ("foo") => unreachable, // intentionally allow else => {}, |
