Thread overview
[Issue 18886] Explicitly invoking super.__ctor in a constructor does not count as calling a super constructor
May 23, 2018
RazvanN
Jun 07, 2018
Adam D. Ruppe
Jun 07, 2018
Adam D. Ruppe
Jun 07, 2018
Adam D. Ruppe
Jun 07, 2018
Ethan Watson
Dec 17, 2022
Iain Buclaw
May 23, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com

--- Comment #1 from Andrei Alexandrescu <andrei@erdani.com> ---
This isn't a bug. Calling __ctor explicitly is advanced usage, not part of the usual typechecking. Is there any strong reason to keep this open? Is it preventing some use case?

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #2 from Adam D. Ruppe <destructionator@gmail.com> ---
The templated constructor use case looks valid, but the language doesn't allow you to explicitly call `super!(args)`...

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

--- Comment #3 from Andrei Alexandrescu <andrei@erdani.com> ---
Then we should allow that call.

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

--- Comment #4 from Adam D. Ruppe <destructionator@gmail.com> ---
yeah i agree.

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

--- Comment #5 from Adam D. Ruppe <destructionator@gmail.com> ---
errr and also while we're at it, perhaps calling `this!(args)` as well, for forwarding to another ctor in the same class.

--
June 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18886

--- Comment #6 from Ethan Watson <gooberman@gmail.com> ---
The code I'm invoking in my current codebase extracts type data from the template parameter for object management.

Another workaround would probably be to have a templated this( Type )( ref Type
val ) in the base class and then call super( this ) from the derived class.
Which feels as janky as it looks.

Supporting super!( Args )() would be far more preferable, won't even need to do
a __ctor hack then.

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=18886

--- Comment #7 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17860

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--