[Bug 177] remove inheritance protection

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 9 02:57:22 PDT 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=177


benoit at tionex.de changed:

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




------- Comment #2 from benoit at tionex.de  2006-06-09 04:57 -------
Is this a misunderstanding?

>From the D-spec, section classes, first paragraph:
"The object-oriented features of D all come from classes. The class hierarchy
has as its root the class Object. Object defines a minimum level of
functionality that each derived class has, and a default implementation for
that functionality."

Now, if one inherits protected or private from any class, the class 'Object' is
no more visible. Thats my point. The compiler does it job right, but the spec
is not logic in this point.

The second argument for removing this protection is that this doesn't make
sense in a language without multiple inheritance. E.g. java does not have this
protected. I think exactly because of this.

Private inheritance is good for a "implemented with" relation. This makes sense
in C++, not in D. In D, a possible way is using mixins. (if bug 106 is fixed ;)
)


-- 




More information about the Digitalmars-d-bugs mailing list