mixed-in ctor not on par with explicit one?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 13 05:57:56 PST 2016


On Wednesday, 13 January 2016 at 13:53:01 UTC, Daniel N wrote:
> This works:

Indeed... but interestingly, it does not work if you define the 
mixin before the new constructor:

  struct Test
  {
      mixin myCtors  mixed;
      alias __ctor = mixed.__ctor;

      this(string s) {}
  }

l.d(10): Error: alias l.Test.__ctor is not a constructor; 
identifiers starting with __ are reserved for the implementation


So yeah, you can make it work, but there do appear to be a few 
bugs with it anyway.


More information about the Digitalmars-d-learn mailing list