mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
set correct closure tag_id
This commit is contained in:
parent
752a2200fd
commit
539f173472
3 changed files with 23 additions and 8 deletions
|
@ -260,10 +260,17 @@ impl<'a> ClosureLayout<'a> {
|
|||
Layout::Union(tags) => {
|
||||
// NOTE it's very important that this Union consists of Closure tags
|
||||
// and is not an unpacked 1-element record
|
||||
|
||||
let tag_id = self
|
||||
.captured
|
||||
.iter()
|
||||
.position(|(tn, _)| *tn == TagName::Closure(original))
|
||||
.unwrap() as _;
|
||||
|
||||
let expr = Expr::Tag {
|
||||
tag_layout: Layout::Union(tags),
|
||||
tag_name: TagName::Closure(original),
|
||||
tag_id: 0,
|
||||
tag_id,
|
||||
union_size: tags.len() as u8,
|
||||
arguments: symbols,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue