fix: type display omittion

This commit is contained in:
Shunsuke Shibayama 2023-07-07 00:31:10 +09:00
parent c0209706bb
commit e6c490e22b
3 changed files with 11 additions and 2 deletions

View file

@ -1073,9 +1073,12 @@ impl LimitedDisplay for Type {
write!(f, "...")?; write!(f, "...")?;
break; break;
} }
write!(f, "; {field} = ")?; write!(f, "{field} = ")?;
t.limited_fmt(f, limit - 1)?; t.limited_fmt(f, limit - 1)?;
} }
if attrs.is_empty() {
write!(f, "=")?;
}
write!(f, "}}") write!(f, "}}")
} }
Self::Subr(sub) => sub.limited_fmt(f, limit), Self::Subr(sub) => sub.limited_fmt(f, limit),

View file

@ -400,6 +400,9 @@ impl LimitedDisplay for TyParam {
write!(f, "{field} = ")?; write!(f, "{field} = ")?;
v.limited_fmt(f, limit - 1)?; v.limited_fmt(f, limit - 1)?;
} }
if rec.is_empty() {
write!(f, "=")?;
}
write!(f, "}}") write!(f, "}}")
} }
Self::Lambda(lambda) => write!(f, "{lambda}"), Self::Lambda(lambda) => write!(f, "{lambda}"),

View file

@ -586,7 +586,7 @@ impl LimitedDisplay for ValueObj {
match self { match self {
Self::Str(s) => { Self::Str(s) => {
if s.len() >= STR_OMIT_THRESHOLD { if s.len() >= STR_OMIT_THRESHOLD {
write!(f, "...") write!(f, "\"(...)\"")
} else { } else {
write!(f, "\"{}\"", s.escape()) write!(f, "\"{}\"", s.escape())
} }
@ -662,6 +662,9 @@ impl LimitedDisplay for ValueObj {
write!(f, "{field} = ")?; write!(f, "{field} = ")?;
v.limited_fmt(f, limit - 1)?; v.limited_fmt(f, limit - 1)?;
} }
if rec.is_empty() {
write!(f, "=")?;
}
write!(f, "}}") write!(f, "}}")
} }
Self::Type(typ) => typ.limited_fmt(f, limit), Self::Type(typ) => typ.limited_fmt(f, limit),