Cannot implicitly convert derived type

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Sun Feb 23 16:20:12 PST 2014


On Monday, 24 February 2014 at 00:09:55 UTC, Jesse Phillips wrote:
> On Sunday, 23 February 2014 at 23:23:07 UTC, Frustrated wrote:
>> Nope. It has nothing to do with the contract. You are totally
>> missing the point.
>
> iGui has a function which takes any iButton. That is a defined 
> contract of iGui, your denial does not change that.

Let me put this another way. I started with the question of why 
you need to break the contract you define. In other words, "What 
is the problem you are trying to solve." But instead you insisted 
the "it must be solved this way" instead of giving details on 
what the problem actually is.

D already provides a way to say that WindowsGui only takes 
WindowsButtons, you did so in your original code, just don't 
extend iGui since that isn't the contract you fulfill.


More information about the Digitalmars-d-learn mailing list