authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-15 01:53:41-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-15 01:53:41-07:00
log32e88251e48d9f4a412b08acbd04d5694ec91e19
tree055c75bc189091a601fa390424f0a70895f6d706
parent03ed3f56cf0df6864f8a61cfe2108a7f6692bfc6

update test case for new const/var compile error

commit 8afafa717f5c036595a3a781c63b6be7b478c025 was created when this error did not exist yet.

1 files changed, 6 insertions(+), 4 deletions(-)

test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig+6-4
......@@ -19,11 +19,13 @@ comptime {
1919
2020export fn entry1() void {
2121 var start: usize = 0;
22 _ = &start;
2223 _ = ptr[start..2];
2324}
2425
2526export fn entry2() void {
2627 var end: usize = 0;
28 _ = &end;
2729 _ = ptr[0..end];
2830}
2931
......@@ -35,7 +37,7 @@ export fn entry2() void {
3537// :13:16: error: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]
3638// :13:16: note: expected '1', found '2'
3739// :17:16: error: end index 2 out of bounds for slice of single-item pointer
38// :22:13: error: unable to resolve comptime value
39// :22:13: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]
40// :27:16: error: unable to resolve comptime value
41// :27:16: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]
40// :23:13: error: unable to resolve comptime value
41// :23:13: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]
42// :29:16: error: unable to resolve comptime value
43// :29:16: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]