diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-08-07 20:34:28 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-08-07 20:34:28 -0700 |
| commit | 799fedf612aa8742c446b015c12d21707a1dbec0 (patch) | |
| tree | 1d9efbc4cb3f6dda9631160784a074e58d6bd479 /src/codegen.zig | |
| parent | f81b2531cb4904064446f84a06f6e09e4120e28a (diff) | |
| download | zig-799fedf612aa8742c446b015c12d21707a1dbec0.tar.gz zig-799fedf612aa8742c446b015c12d21707a1dbec0.zip | |
stage2: pass some error union tests
* Value: rename `error_union` to `eu_payload` and clarify the intended
usage in the doc comments. The way error unions is represented with
Value is fixed to not have ambiguous values.
* Fix codegen for error union constants in all the backends.
* Implement the AIR instructions having to do with error unions in the
LLVM backend.
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index f5cdc518f6..38cc27d5bc 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -4815,7 +4815,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .ErrorUnion => { const error_type = typed_value.ty.errorUnionSet(); const payload_type = typed_value.ty.errorUnionPayload(); - const sub_val = typed_value.val.castTag(.error_union).?.data; + const sub_val = typed_value.val.castTag(.eu_payload).?.data; if (!payload_type.hasCodeGenBits()) { // We use the error type directly as the type. |
