Fixes #883.
This commit is contained in:
parent
ee280bc309
commit
0f9dbfd874
|
@ -476,12 +476,17 @@ impl<'comments> Formatter<'comments> {
|
|||
|
||||
let doc_comments = self.doc_comments(arg.location.start);
|
||||
|
||||
let doc = arg
|
||||
.arg_name
|
||||
.to_doc()
|
||||
.append(" via ")
|
||||
.append(self.expr(&arg.via, false))
|
||||
.group();
|
||||
let doc = match &arg.annotation {
|
||||
None => arg.arg_name.to_doc(),
|
||||
Some(a) => arg
|
||||
.arg_name
|
||||
.to_doc()
|
||||
.append(": ")
|
||||
.append(self.annotation(a)),
|
||||
}
|
||||
.append(" via ")
|
||||
.append(self.expr(&arg.via, false))
|
||||
.group();
|
||||
|
||||
let doc = doc_comments.append(doc.group()).group();
|
||||
|
||||
|
|
|
@ -478,7 +478,7 @@ fn format_many_assignment_patterns() {
|
|||
assert_format!(
|
||||
r#"
|
||||
fn backpassing() -> Int {
|
||||
|
||||
|
||||
let
|
||||
elem, accumulator, wow,
|
||||
who,
|
||||
|
@ -744,3 +744,14 @@ fn fail_expr() {
|
|||
"#
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fuzzer_annotations() {
|
||||
assert_format!(
|
||||
r#"
|
||||
test foo(n: Int via int()) {
|
||||
todo
|
||||
}
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
source: crates/aiken-lang/src/tests/format.rs
|
||||
description: "Code:\n\ntest foo(n: Int via int()) {\n todo\n}\n"
|
||||
---
|
||||
test foo(n: Int via int()) {
|
||||
todo
|
||||
}
|
Loading…
Reference in New Issue