# stage1: add error for slice.len incr beyond bounds · gitcafe/zig

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

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

Visibility: public

Requested revision: f9b85c6e50e22153aff4c87e2ba943d68f24ee8c

Requested commit: f9b85c6e50e22153aff4c87e2ba943d68f24ee8c

Commit: f9b85c6e50e22153aff4c87e2ba943d68f24ee8c

Tree: 0a5825a3c0f930f80f08f596c6f1750d57366252

Author: Michael Dusan

Committer: Veikka Tuominen

## Message

```
stage1: add error for slice.len incr beyond bounds

comptime direct slice.len increment dodges bounds checking but
we can emit an error for it, at least in the simple case.

- promote original assert to compile-error
- add test case

closes #7810

```

## Parents

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

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