mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +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,
|
consume: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// can this type be reference-counted at runtime?
|
// 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 {
|
let info = VarInfo {
|
||||||
reference,
|
reference,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue