Why can't we derive struct's?

Manu turkeyman at gmail.com
Thu Dec 20 18:49:39 UTC 2018


On Thu, Dec 20, 2018 at 8:10 AM H. S. Teoh via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Thu, Dec 20, 2018 at 03:44:34PM +0000, 12345swordy via Digitalmars-d wrote:
> > On Thursday, 20 December 2018 at 15:29:50 UTC, H. S. Teoh wrote:
> > > On Thu, Dec 20, 2018 at 12:15:53AM -0800, Manu via Digitalmars-d wrote:
> > > > On Wed, Dec 19, 2018 at 7:45 PM Walter Bright via Digitalmars-d
> > > > <digitalmars-d at puremagic.com> wrote:
> > > [...]
> > > > > > Why should it be impossible to derive a struct?
> > > > >
> > > > > Because polymorphism makes little sense for a value type.
> > > >
> > > > It's not really polymorphism without a vtable, just simple
> > > > extension. `alias this` produces the same result, it's just more
> > > > wordy, kinda ugly, and boilerplate-ey. It also hogs the `alias this`
> > > > slot.
> > > [...]
> > >
> > > Sigh... when is multiple alias this ever going to happen??
> > >
> > >
> > > T
> >
> > When IgorStepanov quit disappearing on us.
> > https://github.com/dlang/dmd/pull/8378
> [...]
>
> IIRC, that PR was blocked because of disagreements over how ambiguous
> symbols over multiple alias this types would be resolved.  Somebody
> needs to come up with a DIP with well-defined semantics for all the
> details and corner cases before this can move forward.

Sounds like the original accepted DIP needs to be amended?


More information about the Digitalmars-d mailing list