# sema: fix safe integer arithmetic operations on undefined values · gitcafe/zig

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

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

Visibility: public

Requested revision: ec358d6db5a10989590e11bbbbd3bed9f81cf1f4

Requested commit: ec358d6db5a10989590e11bbbbd3bed9f81cf1f4

Commit: ec358d6db5a10989590e11bbbbd3bed9f81cf1f4

Tree: bd5affb8ff6bbbb4ea8ac22554c0a782d73bb261

Author: Techatrix

Committer: Andrew Kelley

## Message

```
sema: fix safe integer arithmetic operations on undefined values

Previously `@as(i64, undefined) +% 1` would produce `@as(@TypeOf(undefined), undefined)` which now gives `@as(i64, undefined)`.
Previously `@as(i64, undefined) +| 1` would hit an assertion which now gives `@as(i64, undefined)`.

```

## Parents

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

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