mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Fix return backpassing case
This commit is contained in:
parent
d56b6b7b20
commit
2389040b39
5 changed files with 43 additions and 2 deletions
|
@ -1683,14 +1683,16 @@ fn fmt_return<'a>(
|
|||
after_return: &Option<&'a Loc<Expr<'a>>>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
|
||||
indent: u16,
|
||||
) {
|
||||
buf.ensure_ends_with_newline();
|
||||
buf.indent(indent);
|
||||
buf.push_str(keyword::RETURN);
|
||||
|
||||
if matches!(return_value.value.extract_spaces().item, Expr::Defs(..)) {
|
||||
if matches!(
|
||||
return_value.value.extract_spaces().item,
|
||||
Expr::Defs(..) | Expr::Backpassing(..)
|
||||
) {
|
||||
buf.ensure_ends_with_newline();
|
||||
} else {
|
||||
buf.spaces(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue