# frontend: make Decl.zir_decl_index typed · gitcafe/zig

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

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

Visibility: public

Requested revision: 256ab68a97cb6a84278c78d93917ab5e8ae53209

Requested commit: 256ab68a97cb6a84278c78d93917ab5e8ae53209

Commit: 256ab68a97cb6a84278c78d93917ab5e8ae53209

Tree: b5838383e70b6c4c0e12a053def4f2af022ec68c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
frontend: make Decl.zir_decl_index typed

This field had the wrong type. It's not a `Zir.Inst.Index`, it's
actually a `Zir.OptionalExtraIndex`. Also, the former is currently
aliased to `u32` while the latter is a nonexhaustive enum that gives us
more type checking.

This commit is preparation for making this field non-optional. Now it
can be changed to `Zir.ExtraIndex` and then the compiler will point out
all the places that the non-optional assumption is being violated.

```

## Parents

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

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