Fixes #883.
This commit is contained in:
parent
ee280bc309
commit
0f9dbfd874
|
@ -476,9 +476,14 @@ impl<'comments> Formatter<'comments> {
|
||||||
|
|
||||||
let doc_comments = self.doc_comments(arg.location.start);
|
let doc_comments = self.doc_comments(arg.location.start);
|
||||||
|
|
||||||
let doc = arg
|
let doc = match &arg.annotation {
|
||||||
|
None => arg.arg_name.to_doc(),
|
||||||
|
Some(a) => arg
|
||||||
.arg_name
|
.arg_name
|
||||||
.to_doc()
|
.to_doc()
|
||||||
|
.append(": ")
|
||||||
|
.append(self.annotation(a)),
|
||||||
|
}
|
||||||
.append(" via ")
|
.append(" via ")
|
||||||
.append(self.expr(&arg.via, false))
|
.append(self.expr(&arg.via, false))
|
||||||
.group();
|
.group();
|
||||||
|
|
|
@ -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