// module rc_match_arm_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: exercises Iter A outer-arm-close partial-drop
fn use_first(p: own Pair) -> Int {
  match p {
    MkPair(a, b) => match a {
      MkCell(w1, _) => 1
    }
  }
}

fn main() -> Unit with IO {
  do io/print_int(use_first(build_pair(1)))
}
