ran into another type inference problem

This commit is contained in:
2024-02-05 17:30:16 -06:00
parent 7def938781
commit 9d41cf0da7
17 changed files with 267 additions and 24 deletions

View File

@@ -105,6 +105,11 @@ where
let comma_sepped_args = allocator.intersperse(args, CommaSep {});
call.append(comma_sepped_args.parens())
}
Expression::Call(_, fun, args) => {
let args = args.iter().map(|x| x.pretty(allocator));
let comma_sepped_args = allocator.intersperse(args, CommaSep {});
fun.pretty(allocator).append(comma_sepped_args.parens())
}
Expression::Block(_, stmts) => match stmts.split_last() {
None => allocator.text("()"),
Some((last, &[])) => last.pretty(allocator),
@@ -167,7 +172,7 @@ fn type_suffix(x: &Option<ConstantType>) -> &'static str {
}
#[derive(Clone, Copy)]
struct CommaSep {}
pub struct CommaSep {}
impl<'a, D, A> Pretty<'a, D, A> for CommaSep
where