aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-08-01 22:42:01 +0100
committermlugg <mlugg@mlugg.co.uk>2023-08-10 10:00:26 +0100
commitf2c8fa769a92eb61c13f2cc0f75c526c8fd729a9 (patch)
tree37f611ef1bd700533987eec239667815a491df6d /lib/std/testing.zig
parent93e53d1e00793d769d4ee39b3cbfd0c88257687d (diff)
downloadzig-f2c8fa769a92eb61c13f2cc0f75c526c8fd729a9.tar.gz
zig-f2c8fa769a92eb61c13f2cc0f75c526c8fd729a9.zip
Sema: refactor generic calls to interleave argument analysis and parameter type resolution
AstGen provides all function call arguments with a result location, referenced through the call instruction index. The idea is that this should be the parameter type, but for `anytype` parameters, we use generic poison, which is required to be handled correctly. Previously, generic instantiations and inline calls worked by evaluating all args in advance, before resolving generic parameter types. This means any generic parameter (not just `anytype` ones) had generic poison result types. This caused missing result locations in some cases. Additionally, the generic instantiation logic caused `zirParam` to analyze the argument types a second time before coercion. This meant that for nominal types (struct/enum/etc), a *new* type was created, distinct to the result type which was previously forwarded to the argument expression. This commit fixes both of these issues. Generic parameter type resolution is now interleaved with argument analysis, so that we don't have unnecessary generic poison types, and generic instantiation logic now handles parameters itself rather than falling through to the standard zirParam logic, so avoids duplicating the types. Resolves: #16566 Resolves: #16258 Resolves: #16753
Diffstat (limited to 'lib/std/testing.zig')
0 files changed, 0 insertions, 0 deletions