address most comments
This commit is contained in:
@@ -2036,6 +2036,8 @@ pub const Key = union(enum) {
|
||||
/// Each element/field stored as an `Index`.
|
||||
/// In the case of sentinel-terminated arrays, the sentinel value *is* stored,
|
||||
/// so the slice length will be one more than the type's array length.
|
||||
/// There must be at least one element which is not `undefined`. If all elements are
|
||||
/// undefined, instead create an undefined value of the aggregate type.
|
||||
aggregate: Aggregate,
|
||||
/// An instance of a union.
|
||||
un: Union,
|
||||
@@ -8408,7 +8410,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, tid: Zcu.PerThread.Id, key: Key) All
|
||||
if (!ip.isUndef(elem)) any_defined = true;
|
||||
assert(ip.typeOf(elem) == child);
|
||||
}
|
||||
assert(any_defined);
|
||||
assert(any_defined); // aggregate fields must not be all undefined
|
||||
},
|
||||
.struct_type => {
|
||||
var any_defined = false;
|
||||
@@ -8416,7 +8418,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, tid: Zcu.PerThread.Id, key: Key) All
|
||||
if (!ip.isUndef(elem)) any_defined = true;
|
||||
assert(ip.typeOf(elem) == field_ty);
|
||||
}
|
||||
assert(any_defined);
|
||||
assert(any_defined); // aggregate fields must not be all undefined
|
||||
},
|
||||
.tuple_type => |tuple_type| {
|
||||
var any_defined = false;
|
||||
@@ -8424,7 +8426,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, tid: Zcu.PerThread.Id, key: Key) All
|
||||
if (!ip.isUndef(elem)) any_defined = true;
|
||||
assert(ip.typeOf(elem) == ty);
|
||||
}
|
||||
assert(any_defined);
|
||||
assert(any_defined); // aggregate fields must not be all undefined
|
||||
},
|
||||
else => unreachable,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user