On 18/03/2020 12:59 AM, Steven Schveighoffer wrote:
I think he's looking for object pattern matching. i.e. you give it an Object, and it runs a block of code based on the derived type.
In case this syntax is unknown: if (MyObject1 myObject = cast(MyObject1)obj) { ... } else if (MyObject2 myObject = cast(MyObject2)obj) { ... } else { ... }