# InternPool: fix coerced func hash/eql same as uncoerced · gitcafe/zig

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

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

Visibility: public

Requested revision: a7f3c2eab427397846f619dba7abb72378ac2ce9

Requested commit: a7f3c2eab427397846f619dba7abb72378ac2ce9

Commit: a7f3c2eab427397846f619dba7abb72378ac2ce9

Tree: 8398c95f4ce6c45ac738c31c4ec2044df49c2103

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
InternPool: fix coerced func hash/eql same as uncoerced

Since the same Key.Func data structure is used for coerced function
bodies as well as uncoerced function bodies, there is danger of them
being hashed and equality-checked as the same. When that happens, the
type of a function body value might be wrong, causing lots of problems.
In this instance, it causes an assertion failure.

This commit fixes it by introducing an `uncoerced_ty` field which
is different than `ty` in the case of `func_coerced` and is used to
differentiate when doing hashing and equality checking.

I have a new behavior test to cover this bug, but it revealed *another*
bug at the same time, so I will fix it in the next commit and and add
the new test therein.

```

## Parents

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

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