This commit is contained in:
Pierre-Henri Trivier 2022-03-04 23:35:53 +01:00
parent cfccb92bf9
commit 1d3aa26193
2 changed files with 15 additions and 0 deletions

View file

@ -293,6 +293,9 @@ impl<'a> Formattable for TypeAnnotation<'a> {
SpaceBefore(ann, spaces) => { SpaceBefore(ann, spaces) => {
buf.newline(); buf.newline();
buf.indent(indent);
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent); fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
ann.format_with_options(buf, parens, Newlines::No, indent) ann.format_with_options(buf, parens, Newlines::No, indent)
} }

View file

@ -2984,6 +2984,18 @@ mod test_fmt {
)); ));
} }
#[test]
fn multiline_higher_order_function() {
expr_formats_same(indoc!(
r#"
foo :
(Str -> Bool) -> Bool
42
"#
));
}
#[test] #[test]
/// Test that everything under examples/ is formatted correctly /// Test that everything under examples/ is formatted correctly
/// If this test fails on your diff, it probably means you need to re-format the examples. /// If this test fails on your diff, it probably means you need to re-format the examples.