[Issue 5380] alias this is not considered with superclass lookup

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 19 10:43:23 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=5380

--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
This is much more of a perplexing problem than it first appears. What order are
things looked up in? Is the alias-this looked up first, or the base classes? Or
are they looked up as the base classes are looked up? What happens if two
different symbols are found via different orderings of when lookups are done?
What happens if the same symbol is found via different lookup paths?

This is the old multiple inheritance problem from C++, one I had wished to
avoid in D.

Max Samukha's comment is a way to inherit class types from struct types, one
use I had not anticipated, and makes me want to step back and question is this
really where we want to go with this?

At least with the current implementation, things are a bit straightforward. The
base classes are looked at. If not found there, the alias-this is looked at,
and that's it.

--


More information about the Digitalmars-d-bugs mailing list