diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2024-12-25 02:58:27 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-25 02:58:27 +0000 |
| commit | 497592c9b45a94fb7b6028bf45b80f183e395a9b (patch) | |
| tree | 467873c408750cb4223f3ccf31775e42ec9fbd5c /test/cases/compile_errors/self_reference_missing_const.zig | |
| parent | af5e731729592af4a5716edd3b1e03264d66ea46 (diff) | |
| parent | 3afda4322c34dedc2319701fdfac3505c8d311e9 (diff) | |
| download | zig-497592c9b45a94fb7b6028bf45b80f183e395a9b.tar.gz zig-497592c9b45a94fb7b6028bf45b80f183e395a9b.zip | |
Merge pull request #22303 from mlugg/131-new
compiler: analyze type and value of global declarations separately
Diffstat (limited to 'test/cases/compile_errors/self_reference_missing_const.zig')
| -rw-r--r-- | test/cases/compile_errors/self_reference_missing_const.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cases/compile_errors/self_reference_missing_const.zig b/test/cases/compile_errors/self_reference_missing_const.zig new file mode 100644 index 0000000000..72b0ac1561 --- /dev/null +++ b/test/cases/compile_errors/self_reference_missing_const.zig @@ -0,0 +1,11 @@ +const S = struct { self: *S, x: u32 }; +const s: S = .{ .self = &s, .x = 123 }; + +comptime { + _ = s; +} + +// error +// +// :2:18: error: expected type '*tmp.S', found '*const tmp.S' +// :2:18: note: cast discards const qualifier |
