# 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/d53cc5e5b2ac51793ea19a847d8cee409af1dee3)

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

Visibility: public

Requested revision: d53cc5e5b2ac51793ea19a847d8cee409af1dee3

Requested commit: d53cc5e5b2ac51793ea19a847d8cee409af1dee3

Commit: d53cc5e5b2ac51793ea19a847d8cee409af1dee3

Tree: e60cee6a989fd62a64d93d9acdc19729f4c44ed7

Author: mlugg

Committer: Andrew Kelley

## 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

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

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