improve function type display

This commit is contained in:
Mark
2023-10-27 14:56:01 +02:00
parent 3b179ba2d4
commit 36e0f69d0c
2 changed files with 61 additions and 45 deletions

View File

@@ -133,6 +133,11 @@ impl Display for Function {
}
impl Display for FunctionT {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Function")
match (self.0)(&Type::empty_tuple()) {
Ok(t) => write!(f, "Function /* () -> {t} */"),
Err(_) => {
write!(f, "Function",)
}
}
}
}