Fix a desugaring bug

This commit is contained in:
Shunsuke Shibayama 2022-12-04 11:44:13 +09:00
parent 48f91f969b
commit e9d0642b29
2 changed files with 18 additions and 1 deletions

View file

@ -1979,7 +1979,13 @@ impl fmt::Display for TypeSpec {
}
write!(f, "}}")
}
Self::Enum(elems) => write!(f, "{{{elems}}}"),
Self::Enum(elems) => {
write!(f, "{{")?;
for elem in elems.pos_args() {
write!(f, "{}, ", elem.expr)?;
}
write!(f, "}}")
}
Self::Interval { op, lhs, rhs } => write!(f, "{lhs}{}{rhs}", op.inspect()),
Self::Subr(s) => write!(f, "{s}"),
Self::TypeApp { spec, args } => write!(f, "{spec}{args}"),