[Issue 1570] Wrong return for address operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 9 13:17:34 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1570





------- Comment #3 from jarrett.billingsley at gmail.com  2008-09-09 15:17 -------
(In reply to comment #2)
> Since I can't at the moment find any evidence in the spec that v.a is a valid
> expression, I'm marking this as accepts-invalid.  If I'm wrong, please show me
> where it's defined.
> 

a is the class a, which for some reason is accessible through a reference to
class b.  If you capitalize the class names it makes it a lot clearer.

I think it might actually be somehow related to the thing about typeof(this)
and non-virtual calls made on the expressions page:

http://www.digitalmars.com/d/1.0/expression.html

In any case it doesn't seem to be explicitly documented, but I wonder if
there's a use for it.  It breaks encapsulation by allowing you to manually
access a base class's implementation of a method, and with single inheritance
there's no need to select the implementation from several base classes.


-- 



More information about the Digitalmars-d-bugs mailing list