mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-13 23:36:29 +00:00
Correctly compile unified recursive tag unions
This commit is contained in:
parent
8c5f798f4e
commit
808d19b01b
7 changed files with 84 additions and 14 deletions
|
@ -2317,6 +2317,8 @@ fn from_can_let<'a>(
|
|||
let (_specialization_mark, (var, specialized_symbol)) =
|
||||
needed_specializations.next().unwrap();
|
||||
|
||||
// Make sure rigid variables in the annotation are converted to flex variables.
|
||||
instantiate_rigids(env.subs, def.expr_var);
|
||||
// Unify the expr_var with the requested specialization once.
|
||||
let _res = env.unify(var, def.expr_var);
|
||||
|
||||
|
@ -2333,6 +2335,9 @@ fn from_can_let<'a>(
|
|||
_n => {
|
||||
let mut stmt = rest;
|
||||
|
||||
// Make sure rigid variables in the annotation are converted to flex variables.
|
||||
instantiate_rigids(env.subs, def.expr_var);
|
||||
|
||||
// Need to eat the cost and create a specialized version of the body for
|
||||
// each specialization.
|
||||
for (_specialization_mark, (var, specialized_symbol)) in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue