type: update optionalReprIsPayload to handle inferred error sets

This commit is contained in:
kcbanner 2023-07-10 00:58:35 -04:00 committed by jacobly0
parent 874d2dd9f7
commit 82a9d5d78d

View File

@ -1869,7 +1869,7 @@ pub const Type = struct {
return switch (mod.intern_pool.indexToKey(ty.toIntern())) { return switch (mod.intern_pool.indexToKey(ty.toIntern())) {
.opt_type => |child_type| child_type == .anyerror_type or switch (mod.intern_pool.indexToKey(child_type)) { .opt_type => |child_type| child_type == .anyerror_type or switch (mod.intern_pool.indexToKey(child_type)) {
.ptr_type => |ptr_type| ptr_type.flags.size != .C and !ptr_type.flags.is_allowzero, .ptr_type => |ptr_type| ptr_type.flags.size != .C and !ptr_type.flags.is_allowzero,
.error_set_type => true, .error_set_type, .inferred_error_set_type => true,
else => false, else => false,
}, },
.ptr_type => |ptr_type| ptr_type.flags.size == .C, .ptr_type => |ptr_type| ptr_type.flags.size == .C,