diff --git a/crates/compiler/mono/src/drop_specialization.rs b/crates/compiler/mono/src/drop_specialization.rs index d9a1ea9df9..1b200508ef 100644 --- a/crates/compiler/mono/src/drop_specialization.rs +++ b/crates/compiler/mono/src/drop_specialization.rs @@ -958,23 +958,20 @@ fn specialize_boxed<'a, 'i>( *symbol, // If the symbol is unique: // - free the box - |_, _, _| { + |_, _, continuation| { arena.alloc(Stmt::Refcounting( // TODO can be replaced by free if ever added to the IR. ModifyRc::DecRef(*symbol), - new_continuation, + continuation, )) }, // If the symbol is not unique: // - increment the child // - decref the box - |_, _, _| { + |_, _, continuation| { arena.alloc(Stmt::Refcounting( ModifyRc::Inc(s, 1), - arena.alloc(Stmt::Refcounting( - ModifyRc::DecRef(*symbol), - new_continuation, - )), + arena.alloc(Stmt::Refcounting(ModifyRc::DecRef(*symbol), continuation)), )) }, new_continuation, diff --git a/crates/compiler/test_mono/src/tests.rs b/crates/compiler/test_mono/src/tests.rs index efc25f6c78..b17d9c9ad3 100644 --- a/crates/compiler/test_mono/src/tests.rs +++ b/crates/compiler/test_mono/src/tests.rs @@ -3028,9 +3028,9 @@ fn specialize_after_match() { listB = Nil longestLinkedList listA listB - + LinkedList a : [Cons a (LinkedList a), Nil] - + longestLinkedList : LinkedList a, LinkedList a -> Nat longestLinkedList = \listA, listB -> when listA is Nil -> linkedListLength listB