authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-11 00:04:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-18 19:02:05-07:00
logd98526f912202c1eb82973ceeb096aa2ccf77832
tree9b43b4d42d045e20ab7736ef73fe43ea27203991
parentb81d1930216122bd3192bff8a47b023d430df6ea

Type.print: fix inferred error set crash

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

1 files changed, 2 insertions(+), 3 deletions(-)

src/type.zig+2-3
...@@ -250,10 +250,9 @@ pub const Type = struct {...@@ -250,10 +250,9 @@ pub const Type = struct {
250 try print(error_union_type.payload_type.toType(), writer, mod);250 try print(error_union_type.payload_type.toType(), writer, mod);
251 return;251 return;
252 },252 },
253 .inferred_error_set_type => |index| {253 .inferred_error_set_type => |func_index| {
254 const func = mod.iesFuncIndex(index);
255 try writer.writeAll("@typeInfo(@typeInfo(@TypeOf(");254 try writer.writeAll("@typeInfo(@typeInfo(@TypeOf(");
256 const owner_decl = mod.funcOwnerDeclPtr(func);255 const owner_decl = mod.funcOwnerDeclPtr(func_index);
257 try owner_decl.renderFullyQualifiedName(mod, writer);256 try owner_decl.renderFullyQualifiedName(mod, writer);
258 try writer.writeAll(")).Fn.return_type.?).ErrorUnion.error_set");257 try writer.writeAll(")).Fn.return_type.?).ErrorUnion.error_set");
259 },258 },