mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
f2c8fa769a
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 |
||
---|---|---|
.. | ||
behavior | ||
c_abi | ||
cases | ||
link | ||
src | ||
standalone | ||
assemble_and_link.zig | ||
behavior.zig | ||
cases.zig | ||
cbe.zig | ||
compare_output.zig | ||
compile_errors.zig | ||
gen_h.zig | ||
link.zig | ||
llvm_targets.zig | ||
nvptx.zig | ||
run_translated_c.zig | ||
stack_traces.zig | ||
standalone.zig | ||
tests.zig | ||
translate_c.zig |