aboutsummaryrefslogtreecommitdiff
path: root/lib/std/array_hash_map.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-14 00:36:54 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-04-14 06:08:28 -0700
commit2a00df9c091498268b58dd671f646a5590439b7a (patch)
treed1fe5b80b9180bd32a75c13e9d3f9ca7700817f3 /lib/std/array_hash_map.zig
parent9b82e7f558d5aa66ac1dc285af2345d46cc3d4d6 (diff)
downloadzig-2a00df9c091498268b58dd671f646a5590439b7a.tar.gz
zig-2a00df9c091498268b58dd671f646a5590439b7a.zip
Sema: fix generic instantiation false negatives
The problem was that types of non-anytype parameters were being included as part of the check to see if generic function instantiations were equal. Now, Module.Fn additionally stores the information for whether each parameter is anytype or not. `generic_poison` cannot be used to signal this because the type is still needed for comptime arguments; in such case the type will not be present in the newly generated function prototype. This presented one additional challenge: we need to compare equality of two values where one of them is post-coercion and the other is not. So we make some minor adjustments to `Type.eql` to support this. I think this small complexity tradeoff is worth it because it means the compiler does much less work on the hot path that a generic function is called and there is already an existing matching instantiation. closes #11146
Diffstat (limited to 'lib/std/array_hash_map.zig')
0 files changed, 0 insertions, 0 deletions