Thread overview
[Issue 177] remove inheritance protection
Jun 13, 2006
d-bugmail
Jun 13, 2006
d-bugmail
Jun 13, 2006
d-bugmail
[Issue 177] Remove inheritance protection
Nov 13, 2007
d-bugmail
Jun 08, 2009
Brad Roberts
Jul 24, 2011
Stewart Gordon
June 13, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=177


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com




------- Comment #3 from smjg@iname.com  2006-06-13 10:15 -------
How is the lack of multiple inheritance a reason that it doesn't make sense?

I agree with your first reason that it doesn't make sense, namely that of hiding the functionality of Object.  Moreover, Java also has the principle that all classes derive from Object, which is probably one reason that Java doesn't have inheritance protection.


-- 

June 13, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=177





------- Comment #4 from benoit@tionex.de  2006-06-13 10:41 -------
(In reply to comment #3)
> How is the lack of multiple inheritance a reason that it doesn't make sense?

A public inheritance is good for "is a" relationship. a private inheritance in C++ can be used for a "is implemented with" relationship.

you write a base class with some functionality, so the user can simply derive from and has this functionality available for a concrete implementation class. But what is this for if you give the user of your class the restriction, not to be able to derive from another public baseclass. Than this is not useful, and so the functionality should be implemented better in an other way. A member object is allways possible (and used in java). Perhaps mixins can be a better solution for many cases.

Or do you know a use-case for this feature?


-- 

June 13, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=177





------- Comment #5 from smjg@iname.com  2006-06-13 10:45 -------
No.  I too think it's a rather pointless feature to have in D.


-- 

November 13, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=177





------- Comment #6 from onlystupidspamhere@yahoo.se  2007-11-13 15:49 -------
FWIW, I don't think there's much to fix other than the spec since this hasn't ever worked (DMD seems to be quite liberal in accepting attributes almost anywhere, but it doesn't mean it enforces anything) and nobody has requested this as far as I know. Also bug #1351 points out that export attribute doesn't even make sense.

Mixins and composition indeed solve "is implemented with" relationship and interfaces can be used to enforce a specific functionality.


-- 

June 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=177


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |braddr@puremagic.com
            Version|unspecified                 |2.000
           Severity|normal                      |enhancement




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=177


Stewart Gordon <smjg@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #7 from Stewart Gordon <smjg@iname.com> 2011-07-24 09:44:36 PDT ---
I wish we had a REDUCED resolution, which takes an issue number in the same way as DUPLICATE.  Meanwhile, for want of that....

*** This issue has been marked as a duplicate of issue 5299 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------