# Sema: allow \`@ptrCast\` slice of zero-bit type to slice of non-zero-bit type · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/f5e7850686a0630015f26cc7f60e9d860a7dd05f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: f5e7850686a0630015f26cc7f60e9d860a7dd05f

Requested commit: f5e7850686a0630015f26cc7f60e9d860a7dd05f

Commit: f5e7850686a0630015f26cc7f60e9d860a7dd05f

Tree: 5f1c2aeffdcf487ed4661e3bc7282386042155dd

Author: mlugg

Committer: Alex Rønne Petersen

## Message

```
Sema: allow `@ptrCast` slice of zero-bit type to slice of non-zero-bit type

This is actually completely well-defined. The resulting slice always has
0 elements. The only disallowed case is casting *to* a slice of a
zero-bit type, because in that case, you cna't figure out how many
destination elements to use (and there's *no* valid destination length
if the source slice corresponds to more than 0 bits).

```

## Parents

- [6ecd14321208e5f4562c2d4e4883aa46423ac725](https://git.cafe/gitcafe/zig/commit/6ecd14321208e5f4562c2d4e4883aa46423ac725?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/f5e7850686a0630015f26cc7f60e9d860a7dd05f?format=markdown)
