mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
only reference count closures if the captured values are RC'd
This commit is contained in:
parent
bc0a6f24ef
commit
c788965182
1 changed files with 4 additions and 1 deletions
|
@ -602,7 +602,10 @@ impl<'a> Context<'a> {
|
|||
consume: bool,
|
||||
) -> Self {
|
||||
// can this type be reference-counted at runtime?
|
||||
let reference = layout.contains_refcounted();
|
||||
let reference = match layout {
|
||||
Layout::Closure(_, closure, _) => closure.layout.contains_refcounted(),
|
||||
_ => layout.contains_refcounted(),
|
||||
};
|
||||
|
||||
let info = VarInfo {
|
||||
reference,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue