Collect deeply nested type names in alias analysis

Previously we only collected type names that appeared on the surface of
a type during alias analysis, but certain types that need to be named
(i.e. recursive types) may be observed only when we actually convert the IR
to the morphic IR. Make sure we collect those appropriately.

This is a cherry pick of the relevant changes in #4121.
This commit is contained in:
Ayaz Hafiz 2022-11-15 09:23:28 -06:00
parent de472015f6
commit 3723071c15
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 218 additions and 139 deletions

View file

@ -4259,12 +4259,16 @@ fn build_procedures_help<'a, 'ctx, 'env>(
let it = procedures.iter().map(|x| x.1);
let solutions =
match roc_alias_analysis::spec_program(env.layout_interner, opt_level, opt_entry_point, it)
{
Err(e) => panic!("Error in alias analysis: {}", e),
Ok(solutions) => solutions,
};
let solutions = match roc_alias_analysis::spec_program(
env.arena,
env.layout_interner,
opt_level,
opt_entry_point,
it,
) {
Err(e) => panic!("Error in alias analysis: {}", e),
Ok(solutions) => solutions,
};
let solutions = env.arena.alloc(solutions);