[Issue 2538] New: Private inheritance doesn't work for interfaces
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 22 16:29:22 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2538
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
AssignedTo: bugzilla at digitalmars.com
ReportedBy: 2korden at gmail.com
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
connection).
Both DMD1.x and DMD2.x are affected.
--
More information about the Digitalmars-d-bugs
mailing list