I am dealing with an interface as follows:
public interface ISomething { ...many auto-props, void SetValues(ISomething thing) } Now, I don't own this interface, but I'd like to extend it with a couple more properties:
public interface ISomethingMoreSpecific : ISomething { ...existing + my props, void SetValues(ISomething thing) } In the class the implements ISomethingMoreSpecific I've implemented an overload that takes the derived interface and handles both my props and the base interface properties.
public void SetValues(ISomethingMoreSpecific specificThing) { ...set my props and base props } The calling code does the following:
myThing.SetValues((ISomethingMoreSpecific)otherThing); With or without the cast, the method will not dispatch to my overload even though otherThing and myThing are concrete types implementing ISomethingMoreSpecific. I am guessing I'm overlooking something simple, but what is it?