fix two bugs in the dev backend

This commit is contained in:
Folkert 2023-09-12 17:35:08 +02:00
parent dfee6740dd
commit 3909443ef4
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 92 additions and 10 deletions

View file

@ -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) => {