I often rely on polymorphic overloads of the same method to handle DU cases indivdually:
Ideally I would have some syntax like this:
shape.Dipatch(Canvas.Draw);
This is obviously not possible, usually I write code like this: I write a public function which is delegating to individual overloads of the same Methodgroup. This is similar to the accept method in the visitor pattern:
I often rely on polymorphic overloads of the same method to handle DU cases indivdually:
Ideally I would have some syntax like this:
This is obviously not possible, usually I write code like this: I write a public function which is delegating to individual overloads of the same Methodgroup. This is similar to the accept method in the visitor pattern:
Source Generator:
DispatchToMethodGroup could take a parameter name optionally.