aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-04 14:28:30 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-04-04 14:29:08 -0700
commit51ef31a8331e92103253a37ddfdacbd263cee81d (patch)
tree4c4d493f1daa49a8fe04cb22d8f0485a90af7504 /test
parentb4bf3bdf7eac05c5e4ff887294385946f4dd5f3f (diff)
downloadzig-51ef31a8331e92103253a37ddfdacbd263cee81d.tar.gz
zig-51ef31a8331e92103253a37ddfdacbd263cee81d.zip
Sema: add empty tuple to mutable slice coercion
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);
+}