fixing struct type display

This commit is contained in:
Jakub Doka 2024-09-30 22:17:54 +02:00
parent 006bc80f12
commit 1f5846afaa
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -392,13 +392,18 @@ mod ty {
let record = &self.tys.structs[idx as usize];
if ident::is_null(record.name) {
write!(f, "[{idx}]{{")?;
for (i, &super::Field { ref name, ty }) in
for (i, &super::Field { name, ty }) in
self.tys.struct_fields(idx).iter().enumerate()
{
if i != 0 {
write!(f, ", ")?;
}
write!(f, "{name}: {}", self.rety(ty))?;
write!(
f,
"{}: {}",
self.tys.field_names.ident_str(name),
self.rety(ty)
)?;
}
write!(f, "}}")
} else {