mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 12:14:43 +00:00
fix: type display omittion
This commit is contained in:
parent
c0209706bb
commit
e6c490e22b
3 changed files with 11 additions and 2 deletions
|
@ -1073,9 +1073,12 @@ impl LimitedDisplay for Type {
|
|||
write!(f, "...")?;
|
||||
break;
|
||||
}
|
||||
write!(f, "; {field} = ")?;
|
||||
write!(f, "{field} = ")?;
|
||||
t.limited_fmt(f, limit - 1)?;
|
||||
}
|
||||
if attrs.is_empty() {
|
||||
write!(f, "=")?;
|
||||
}
|
||||
write!(f, "}}")
|
||||
}
|
||||
Self::Subr(sub) => sub.limited_fmt(f, limit),
|
||||
|
|
|
@ -400,6 +400,9 @@ impl LimitedDisplay for TyParam {
|
|||
write!(f, "{field} = ")?;
|
||||
v.limited_fmt(f, limit - 1)?;
|
||||
}
|
||||
if rec.is_empty() {
|
||||
write!(f, "=")?;
|
||||
}
|
||||
write!(f, "}}")
|
||||
}
|
||||
Self::Lambda(lambda) => write!(f, "{lambda}"),
|
||||
|
|
|
@ -586,7 +586,7 @@ impl LimitedDisplay for ValueObj {
|
|||
match self {
|
||||
Self::Str(s) => {
|
||||
if s.len() >= STR_OMIT_THRESHOLD {
|
||||
write!(f, "...")
|
||||
write!(f, "\"(...)\"")
|
||||
} else {
|
||||
write!(f, "\"{}\"", s.escape())
|
||||
}
|
||||
|
@ -662,6 +662,9 @@ impl LimitedDisplay for ValueObj {
|
|||
write!(f, "{field} = ")?;
|
||||
v.limited_fmt(f, limit - 1)?;
|
||||
}
|
||||
if rec.is_empty() {
|
||||
write!(f, "=")?;
|
||||
}
|
||||
write!(f, "}}")
|
||||
}
|
||||
Self::Type(typ) => typ.limited_fmt(f, limit),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue