// 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: own 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) -> own Int {
  match c {
    MkCell(w1, w2) => 1
  }
}

fn main() -> own Unit with IO {
  print(match build_pair(1) {
    MkPair(a, _) => use_cell(a)
  })
}
