mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Fixes #2586
This commit is contained in:
parent
cfccb92bf9
commit
1d3aa26193
2 changed files with 15 additions and 0 deletions
|
@ -293,6 +293,9 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
|
||||
SpaceBefore(ann, spaces) => {
|
||||
buf.newline();
|
||||
|
||||
buf.indent(indent);
|
||||
|
||||
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
|
||||
ann.format_with_options(buf, parens, Newlines::No, indent)
|
||||
}
|
||||
|
|
|
@ -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 that everything under examples/ is formatted correctly
|
||||
/// If this test fails on your diff, it probably means you need to re-format the examples.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue