aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-07-11 00:04:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-07-18 19:02:05 -0700
commitd98526f912202c1eb82973ceeb096aa2ccf77832 (patch)
tree9b43b4d42d045e20ab7736ef73fe43ea27203991 /src
parentb81d1930216122bd3192bff8a47b023d430df6ea (diff)
downloadzig-d98526f912202c1eb82973ceeb096aa2ccf77832.tar.gz
zig-d98526f912202c1eb82973ceeb096aa2ccf77832.zip
Type.print: fix inferred error set crash
The index is a function, not an inferred error set.
Diffstat (limited to 'src')
-rw-r--r--src/type.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/type.zig b/src/type.zig
index a5483c2128..8fcab8fcd0 100644
--- 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");
},