diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-09 00:10:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-09 00:10:53 -0700 |
| commit | 97019bc56d27349e0aeb44faa9d3f738887abe7f (patch) | |
| tree | 4c9ceb095fa8885a21a77030108d8cae90173e3e /test/behavior/basic.zig | |
| parent | f4fa32a63219917e8fb26f43cbd2d97b17e0aeee (diff) | |
| download | zig-97019bc56d27349e0aeb44faa9d3f738887abe7f.tar.gz zig-97019bc56d27349e0aeb44faa9d3f738887abe7f.zip | |
Sema: handle inferred error set tail call
When Sema sees a store_node instruction, it now checks for
the possibility of this pattern:
%a = ret_ptr
%b = store(%a, %c)
Where %c is an error union. In such case we need to add to the
current function's inferred error set, if any.
Coercion from error union to error union will be handled ideally if the
operand is comptime known. In such case it does the appropriate
unwrapping, then wraps again.
In the future, coercion from error union to error union should do the
same thing for a runtime value; emitting a runtime branch to check if
the value is an error or not.
`Value.arrayLen` for structs returns the number of fields. This is so
that Liveness can use it for the `vector_init` instruction (soon to be
renamed to `aggregate_init`).
Diffstat (limited to 'test/behavior/basic.zig')
0 files changed, 0 insertions, 0 deletions
