mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
fix two bugs in the dev backend
This commit is contained in:
parent
dfee6740dd
commit
3909443ef4
4 changed files with 92 additions and 10 deletions
|
@ -3644,12 +3644,25 @@ fn specialize_proc_help<'a>(
|
|||
|
||||
let symbol = get_specialized_name(**symbol);
|
||||
|
||||
let fresh_symbol =
|
||||
env.named_unique_symbol(&format!("{:?}_closure", symbol));
|
||||
|
||||
specialized_body = Stmt::Let(
|
||||
symbol,
|
||||
fresh_symbol,
|
||||
expr,
|
||||
layout,
|
||||
env.arena.alloc(specialized_body),
|
||||
);
|
||||
|
||||
// the same symbol may be used where
|
||||
// - the closure is created
|
||||
// - the closure is consumed
|
||||
substitute_in_exprs(
|
||||
env.arena,
|
||||
&mut specialized_body,
|
||||
symbol,
|
||||
fresh_symbol,
|
||||
);
|
||||
}
|
||||
}
|
||||
ClosureRepresentation::AlphabeticOrderStruct(field_layouts) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue