# Sema: slice improvements · gitcafe/zig

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

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

Visibility: public

Requested revision: 0893326e0ea9b261c5d334067c294c7d8972d5a1

Requested commit: 0893326e0ea9b261c5d334067c294c7d8972d5a1

Commit: 0893326e0ea9b261c5d334067c294c7d8972d5a1

Tree: d91c43cbe138a37aca438f8adc6c747abafa346b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: slice improvements

 * resolve_inferred_alloc now gives a proper mutability attribute to the
   corresponding alloc instruction. Previously, it would fail to mark
   things const.
 * slicing: fix the detection for when the end index equals the length
   of the underlying object. Previously it was using `end - start` but
   it should just use the end index directly. It also takes into account
   when slicing a comptime-known slice.
 * `Type.sentinel`: fix not handling all slice tags

```

## Parents

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

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