Skip to content

Commit 32e8825

Browse files
committed
update test case for new const/var compile error
commit 8afafa7 was created when this error did not exist yet.
1 parent 03ed3f5 commit 32e8825

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ comptime {
1919

2020
export fn entry1() void {
2121
var start: usize = 0;
22+
_ = &start;
2223
_ = ptr[start..2];
2324
}
2425

2526
export 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]

0 commit comments

Comments
 (0)