From 799fedf612aa8742c446b015c12d21707a1dbec0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 7 Aug 2021 20:34:28 -0700 Subject: 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. --- src/codegen.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codegen.zig') 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. -- cgit v1.2.3