stage2: formatting an error_set value should print members, not decl

This commit is contained in:
Mitchell Hashimoto
2022-03-17 17:49:47 -07:00
committed by Andrew Kelley
parent 5765755fcd
commit 3865a61a99

View File

@@ -1788,8 +1788,14 @@ pub const Type = extern union {
continue;
},
.error_set => {
const error_set = ty.castTag(.error_set).?.data;
return writer.writeAll(std.mem.sliceTo(error_set.owner_decl.name, 0));
const names = ty.castTag(.error_set).?.data.names.keys();
try writer.writeAll("error{");
for (names) |name, i| {
if (i != 0) try writer.writeByte(',');
try writer.writeAll(name);
}
try writer.writeAll("}");
return;
},
.error_set_inferred => {
const func = ty.castTag(.error_set_inferred).?.data.func;