diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-04-04 14:28:30 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-04-04 14:29:08 -0700 |
| commit | 51ef31a8331e92103253a37ddfdacbd263cee81d (patch) | |
| tree | 4c4d493f1daa49a8fe04cb22d8f0485a90af7504 /test | |
| parent | b4bf3bdf7eac05c5e4ff887294385946f4dd5f3f (diff) | |
| download | zig-51ef31a8331e92103253a37ddfdacbd263cee81d.tar.gz zig-51ef31a8331e92103253a37ddfdacbd263cee81d.zip | |
Sema: add empty tuple to mutable slice coercion
Diffstat (limited to 'test')
| -rw-r--r-- | test/behavior/cast.zig | 5 |
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); +} |
