mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
fix recursion layout issue
This commit is contained in:
parent
1aa71113ca
commit
06bf614437
4 changed files with 25 additions and 4 deletions
|
@ -423,6 +423,12 @@ impl<'a, 'b> Env<'a, 'b> {
|
|||
|
||||
self.seen.insert(var)
|
||||
}
|
||||
|
||||
fn remove_seen(&mut self, var: Variable) -> bool {
|
||||
let var = self.subs.get_root_key_without_compacting(var);
|
||||
|
||||
self.seen.remove(&var)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Layout<'a> {
|
||||
|
@ -1248,6 +1254,8 @@ fn layout_from_flat_type<'a>(
|
|||
UnionLayout::Recursive(tag_layouts.into_bump_slice())
|
||||
};
|
||||
|
||||
env.remove_seen(rec_var);
|
||||
|
||||
Ok(Layout::Union(union_layout))
|
||||
}
|
||||
EmptyTagUnion => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue