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?
Comment #2 by destructionator — 2018-06-07T20:22:22Z
The templated constructor use case looks valid, but the language doesn't allow you to explicitly call `super!(args)`...
Comment #3 by andrei — 2018-06-07T20:23:17Z
Then we should allow that call.
Comment #4 by destructionator — 2018-06-07T20:25:34Z
yeah i agree.
Comment #5 by destructionator — 2018-06-07T20:26:10Z
errr and also while we're at it, perhaps calling `this!(args)` as well, for forwarding to another ctor in the same class.
Comment #6 by gooberman — 2018-06-07T21:09:00Z
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.
Comment #7 by robert.schadek — 2024-12-13T18:58:49Z