# Sema: simplify coercion logic · gitcafe/zig

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

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

Visibility: public

Requested revision: 6fdf7ce0af1c3ca210c3f49de4f833afee282076

Requested commit: 6fdf7ce0af1c3ca210c3f49de4f833afee282076

Commit: 6fdf7ce0af1c3ca210c3f49de4f833afee282076

Tree: 2896a0322e9948123b2dfd5fa0550147b9755e17

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: simplify coercion logic

Instead of a separate function, `coerceNum` for handling comptime-known
number coercion, outside of the main switch, the `coerce` function now
has a single big switch statement that decides the control flow based on
the zig type tag.

```

## Parents

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

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