Better way to call overloaded functions with more-derived parameters, passing in less-derived types
问题 I have 16 methods that take two parameters, and each of the two parameters can be either an 'Insertion' or a 'Deletion', both of which implement IFragment. I also have four helper functions like this: static IFragment[] IntroduceAntecedent(IFragment on, IFragment item) { bool onIsInsertion = on is Insertion; bool itemIsInsertion = item is Insertion; if (onIsInsertion) { if (itemIsInsertion) { return IntroduceAntecedent((Insertion) on, (Insertion) item); } else { return IntroduceAntecedent(