Summary: Private inheritance doesn't work for interfaces
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

Whenever I inherit from interface privately, compiler rises an error that
inherited abstract methods are not implemented:

module test;

interface NetworkListener
    void onConnect();

class SoundManager : private NetworkListener
    private final void onConnect()

test.d(8): class test.SoundManager interface function NetworkListener.onConnect
isn't implemented

I use private inheritance because I don't want my classes to be used as
listeners by anyone but the class itself (or module it is declared in). Use
case: it is an implementation detail that SoundManager is also a
NetworkListener (because I allow tuning sounds from authoring tool via debug

Both DMD1.x and DMD2.x are affected.


Reply via email to