aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/behavior/cast.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/cast.zig b/test/behavior/cast.zig
index 4e952828c5..0473a36033 100644
--- a/test/behavior/cast.zig
+++ b/test/behavior/cast.zig
@@ -1386,3 +1386,8 @@ test "coerce undefined single-item pointer of array to error union of slice" {
const s = try b;
try expect(s.len == 0);
}
+
+test "pointer to empty struct literal to mutable slice" {
+ var x: []i32 = &.{};
+ try expect(x.len == 0);
+}