diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-28 20:05:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-28 20:05:21 -0700 |
| commit | d5131e91eba9324eda3a2ae47eb2aa4530c87e83 (patch) | |
| tree | 62abf5656b3392f738d48f848d3fc64bbc60c19a /src/Module.zig | |
| parent | 157f66ec077ad02f08891bec1a426c0ffef98e09 (diff) | |
| download | zig-d5131e91eba9324eda3a2ae47eb2aa4530c87e83.tar.gz zig-d5131e91eba9324eda3a2ae47eb2aa4530c87e83.zip | |
Sema: complete the Type.hash function
Similar to how Type.eql was reworked in the previous commit, this commit
reworks Type.hash to check all the different kinds of tags that a Type
can be represented with. It also completes the implementation for all
types except error sets, which need to have Type.eql enhanced as well.
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Module.zig b/src/Module.zig index 8fed3138e7..847e78f1f2 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -157,8 +157,8 @@ const MonomorphedFuncsContext = struct { // The generic function Decl is guaranteed to be the first dependency // of each of its instantiations. const generic_owner_decl = key.owner_decl.dependencies.keys()[0]; - const generic_func = generic_owner_decl.val.castTag(.function).?.data; - std.hash.autoHash(&hasher, @ptrToInt(generic_func)); + const generic_func: *const Fn = generic_owner_decl.val.castTag(.function).?.data; + std.hash.autoHash(&hasher, generic_func); // This logic must be kept in sync with the logic in `analyzeCall` that // computes the hash. |
