# stage1: \`@intToEnum\` implicitly does an \`@intCast\` · gitcafe/zig

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

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

Visibility: public

Requested revision: bb38931c7146678548f63ae9ef71e534c7598fe3

Requested commit: bb38931c7146678548f63ae9ef71e534c7598fe3

Commit: bb38931c7146678548f63ae9ef71e534c7598fe3

Tree: 3169ee6a69165cd9bebfc6676fb8f18d7684f390

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage1: `@intToEnum` implicitly does an `@intCast`

This is a backwards-compatible language change.

Previously, `@intToEnum` coerced its integer operand to the integer tag
type of the destination enum type, often requiring the callsite to
additionally wrap the operand in an `@intCast`. Now, the `@intCast` is
implicit, and any integer operand can be passed to `@intToEnum`.

The same as before, it is illegal behavior to pass any integer which does
not have a corresponding enum tag.

```

## Parents

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

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