implement vs override

Peter C peterc at gmail.com
Sun Nov 2 00:00:35 UTC 2025


On Saturday, 1 November 2025 at 13:47:22 UTC, Dejan Lekic wrote:
> On Saturday, 1 November 2025 at 06:41:57 UTC, Peter C wrote:
>> ok. now we have the 'accidental implementation' problem.
>>
>
> There is nothing "accidental" there - you have made the 
> decision to inherit from Base, and should know what that means!

Just because you know what it means, doesn't mean I know what it 
means.

The compiler sure seems to know what it means.

But it's not an absolute that in this situation that the 
programmer would know what it means - and I specifically use 
myself as a case study here ;-)

Also, will the next programmer maintaining your code know what it 
means?

interface Isomething
{
   void someMethod();
}

class Base
{
     void someMethod() {}
}

class Derived : Base, Isomething
{
    // is Derived fullfilling the semantic requirements of 
interface contract here?
}



More information about the Digitalmars-d mailing list