zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d98526f912202c1eb82973ceeb096aa2ccf77832 (tree)
parent b81d1930216122bd3192bff8a47b023d430df6ea
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 11 Jul 2023 00:04:43 -0700

Type.print: fix inferred error set crash

The index is a function, not an inferred error set.

Diffstat:
Msrc/type.zig | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/type.zig b/src/type.zig @@ -250,10 +250,9 @@ pub const Type = struct { try print(error_union_type.payload_type.toType(), writer, mod); return; }, - .inferred_error_set_type => |index| { - const func = mod.iesFuncIndex(index); + .inferred_error_set_type => |func_index| { try writer.writeAll("@typeInfo(@typeInfo(@TypeOf("); - const owner_decl = mod.funcOwnerDeclPtr(func); + const owner_decl = mod.funcOwnerDeclPtr(func_index); try owner_decl.renderFullyQualifiedName(mod, writer); try writer.writeAll(")).Fn.return_type.?).ErrorUnion.error_set"); },