Wrap int properly

This commit is contained in:
ayazhafiz 2022-07-05 23:16:59 -04:00
parent 4a214fe75b
commit 24b605a369
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
2 changed files with 17 additions and 15 deletions

View file

@ -839,21 +839,23 @@ fn write_integer<'a>(
macro_rules! derive_num_writes {
($($lit:expr, $tag:path)*) => {
write_parens!(
write_parens,
buf,
match content {
$(
&Alias($tag, _, _, _) => {
buf.push_str($lit)
},
)*
actual => {
buf.push_str("Int ");
write_content(env, ctx, actual, subs, buf, parens);
}
match content {
$(
&Alias($tag, _, _, _) => {
buf.push_str($lit)
},
)*
actual => {
write_parens!(
write_parens,
buf,
{
buf.push_str("Int ");
write_content(env, ctx, actual, subs, buf, parens);
}
)
}
)
}
}
}

View file

@ -301,7 +301,7 @@ fn nested_num_list() {
fn nested_int_list() {
expect_success(
r#"[[[4, 3, 2], [1, 0x0]], [[]], []]"#,
r#"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List Int *))"#,
r#"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Int *)))"#,
);
}