aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
diff options
context:
space:
mode:
authordweiller <4678790+dweiller@users.noreply.github.com>2024-12-31 16:07:08 +1100
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-07-31 12:02:19 +0100
commit19fc5f4fb29a525252b2eaf3f6388d07f97bd32f (patch)
tree2ef144edec2325d943ab8601c686aaab4ebacae5 /test/behavior
parentbce6a7c21529e9b294a641b5d7472c000204aaef (diff)
downloadzig-19fc5f4fb29a525252b2eaf3f6388d07f97bd32f.tar.gz
zig-19fc5f4fb29a525252b2eaf3f6388d07f97bd32f.zip
Sema: disallow slicing many-item pointer with different sentinel
This change prevents adding or changing the sentinel in the type of a many-item pointer via the slicing syntax `ptr[a.. :S]`.
Diffstat (limited to 'test/behavior')
-rw-r--r--test/behavior/slice.zig3
1 files changed, 0 insertions, 3 deletions
diff --git a/test/behavior/slice.zig b/test/behavior/slice.zig
index 25b501e841..22e4e06dfe 100644
--- a/test/behavior/slice.zig
+++ b/test/behavior/slice.zig
@@ -628,9 +628,6 @@ test "slice syntax resulting in pointer-to-array" {
comptime assert(@TypeOf(ptr[1..][0..2]) == *[2]u8);
comptime assert(@TypeOf(ptr[1..][0..4]) == *[4]u8);
comptime assert(@TypeOf(ptr[1..][0..2 :4]) == *[2:4]u8);
- comptime assert(@TypeOf(ptr[1.. :0][0..2]) == *[2]u8);
- comptime assert(@TypeOf(ptr[1.. :0][0..4]) == *[4]u8);
- comptime assert(@TypeOf(ptr[1.. :0][0..2 :4]) == *[2:4]u8);
var ptr_z: [*:0]u8 = &array;
comptime assert(@TypeOf(ptr_z[1..][0..2]) == *[2]u8);