// module rc_app_let_partial_drop_leak

data Wrap = MkWrap(Int)

data Cell = MkCell(Wrap, Wrap)

data Pair = MkPair(Cell, Cell)

fn build_pair(n: Int) -> own Pair {
  MkPair(MkCell(MkWrap(n), MkWrap(2)), MkCell(MkWrap(3), MkWrap(4)))
}

// @suppress over-strict-mode: RC codegen test: shape used to feed App-bound let-close partial-drop into use_cell
fn use_cell(c: own Cell) -> Int {
  match c {
    MkCell(w1, w2) => 1
  }
}

fn main() -> Unit with IO {
  do io/print_int(match build_pair(1) {
    MkPair(a, _) => use_cell(a)
  })
}
