I made a similar post not so long ago:
It looks into a lot of edge cases, like for example:
tree match
  case Wrap(subtree) | Leaf(subtree: Int) =>
    // What should be the type of subtree here ?
            I made a similar post not so long ago:
It looks into a lot of edge cases, like for example:
tree match
  case Wrap(subtree) | Leaf(subtree: Int) =>
    // What should be the type of subtree here ?