Be sure to correctly print multiple unrelated recursion structures as needed

This commit is contained in:
Ayaz Hafiz 2023-02-13 17:15:34 -06:00
parent a3de22c88a
commit 4844c278a8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -430,6 +430,11 @@ fn name_all_type_vars(variable: Variable, subs: &mut Subs, debug_print: DebugPri
// set_root_name(root, (format!("<{:?}>", root).into()), subs);
match appearances.get(&root) {
Some(Appearances::Multiple) => {
if let Content::RecursionVar { structure, .. } =
subs.get_content_without_compacting(root)
{
recursion_structs_to_expand.push(*structure);
}
letters_used = name_root(letters_used, root, subs, &mut taken, debug_print);
}
Some(Appearances::Single) => {
@ -692,6 +697,8 @@ fn write_content<'a>(
parens,
pol,
);
ctx.recursion_structs_to_expand.push(*structure);
} else {
let name = &subs.field_names[name_index.index as usize];
buf.push_str(name.as_str())