www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13355] New: Inherited classes doesn't see a parent's default

https://issues.dlang.org/show_bug.cgi?id=13355

          Issue ID: 13355
           Summary: Inherited classes doesn't see a parent's default ctor
                    added by mixin template (DMD 2.066)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: alexandrond yandex.ru

mixin template foobar()
{
    this() { }
}

class One
{
    mixin foobar;
    this(int a) //without this ctor all will be fine
    {
        this(); //default ctor is available from here, but not from Two 
    }
};

class Two:One 
{

};

...

Error: Cannot implicitly generate a default ctor when base class main.One is
missing a default ctor.

Windows 7, x86_64, DMD 2.066.

--
Aug 22 2014