Look, I am not trying to be antagonistic here. But my reading of the language specification is that patterns are not expressions, they just try to look similar: Expressions | Scala 3.4 Pattern Matching | Scala 3.4
I think we have different reasons on why this might be a useful feature to have, so I’ll not distract the discussion with my view anymore.
Yes, that is technically correct. Nevertheless, in a pattern like Right(foo), the identifier Right refers to an object whose unapply method is going to be called, and I find it a strange restriction that arbitrary expressions are not allowed there.