Thread overview
[Issue 9066] Add constructor inheritance feature
Oct 20, 2014
Martin Nowak
Oct 20, 2014
Martin Nowak
Sep 04, 2016
Andrej Mitrovic
Sep 04, 2016
Andrej Mitrovic
Sep 04, 2016
Andrej Mitrovic
Dec 17, 2022
Iain Buclaw
October 20, 2014
https://issues.dlang.org/show_bug.cgi?id=9066

--- Comment #15 from Martin Nowak <code@dawg.eu> ---
This has been requested before by Sean Kelly with a good description. http://forum.dlang.org/thread/f3pisd$4vi$3@digitalmars.com

--
October 20, 2014
https://issues.dlang.org/show_bug.cgi?id=9066

--- Comment #16 from Martin Nowak <code@dawg.eu> ---
We should probably write a DIP for it.

--
September 04, 2016
https://issues.dlang.org/show_bug.cgi?id=9066

--- Comment #17 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
(In reply to Martin Nowak from comment #13)
> - You can use @disable this(int) in the derived class to selectively
>   disable some of the super class constructors.

Thinking about this now, I think this specific point may be a bad idea since the base class may be in a 3rd part library. If the authors of the base class introduce yet another new constructor you have to be vigilant and check if you need to add any new @disable this(...) declarations in your own subclass.

This is similar to the base class method hijacking problem https://dlang.org/hijack.html ("Base Class Member Function Hijacking"), but it would be a bigger problem for constructors as listed in https://issues.dlang.org/show_bug.cgi?id=9066#c8

I'll begin working on a DIP.

--
September 04, 2016
https://issues.dlang.org/show_bug.cgi?id=9066

--- Comment #18 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
https://github.com/dlang/DIPs/pull/42

--
September 04, 2016
https://issues.dlang.org/show_bug.cgi?id=9066

--- Comment #19 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
(In reply to Andrej Mitrovic from comment #18)
> https://github.com/dlang/DIPs/pull/42

And yes I omitted the whole `super(Arguments)` stuff as I believe it would complicate the implementation. C++11 doesn't seem to add support for inheriting specific constructors, and it seems that wasn't a cause for concern.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=9066

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--