Could you expand upon that? If I can do this:
var area = shape is Line l ? 0
: shape is Rectangle r ? r.Width * r.Height
: shape is Circle c ? Math.PI * c.Radius * c.Radius
: throw new ApplicationException();
How is this, a collection of predicates and expressions, not the same? var area = switch(shape)
{
case Line l => 0;
case Rectangle r => r.Width * r.Height;
case Circle c => Math.PI * c.Radius * c.Radius;
default => throw new ApplicationException();
}
I realise you work on Roslyn (and you said semantics, so my example may be a bit off), so I'd love the detail on why the above is problematic.