Bar1 { InnerBar.Prop1: var p1 }
PropType p = bar switch { Bar1 { Prop1: var p1 } => p1, Bar2 { Prop2: var p2 } => p2, _ => null // or throw...}if (p != null) // do stuff...
Prop
IOperation