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,9 +839,6 @@ fn write_integer<'a>(
macro_rules! derive_num_writes { macro_rules! derive_num_writes {
($($lit:expr, $tag:path)*) => { ($($lit:expr, $tag:path)*) => {
write_parens!(
write_parens,
buf,
match content { match content {
$( $(
&Alias($tag, _, _, _) => { &Alias($tag, _, _, _) => {
@ -849,13 +846,18 @@ fn write_integer<'a>(
}, },
)* )*
actual => { actual => {
write_parens!(
write_parens,
buf,
{
buf.push_str("Int "); buf.push_str("Int ");
write_content(env, ctx, actual, subs, buf, parens); write_content(env, ctx, actual, subs, buf, parens);
} }
}
) )
} }
} }
}
}
derive_num_writes! { derive_num_writes! {
"U8", Symbol::NUM_UNSIGNED8 "U8", Symbol::NUM_UNSIGNED8

View file

@ -301,7 +301,7 @@ fn nested_num_list() {
fn nested_int_list() { fn nested_int_list() {
expect_success( expect_success(
r#"[[[4, 3, 2], [1, 0x0]], [[]], []]"#, 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 *)))"#,
); );
} }