# stage2: able to slice to sentinel index at comptime · gitcafe/zig

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

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

Visibility: public

Requested revision: a36f4ee290fa9f3f1515e8aa9bd2bb0f0117c505

Requested commit: a36f4ee290fa9f3f1515e8aa9bd2bb0f0117c505

Commit: a36f4ee290fa9f3f1515e8aa9bd2bb0f0117c505

Tree: 48684ef68021b319f9ed9844c5222e998a21b9e5

Author: Mitchell Hashimoto

Committer: Andrew Kelley

## Message

```
stage2: able to slice to sentinel index at comptime

The runtime behavior allowed this in both stage1 and stage2, but stage1
fails with index out of bounds during comptime. This behavior makes
sense to support, and comptime behavior should match runtime behavior. I
implement this fix only in stage2.

```

## Parents

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

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