Pre-SIP: Bind variables for alternative patterns

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 ?
1 Like