Re: private constructors and inheritance

2014-04-29 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 29 April 2014 at 18:51:15 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 29 Apr 2014 13:59:28 + John Colvin via Digitalmars-d-learn wrote: Can someone explain why this can't/doesn't work? Thanks. hm. why it should? there is no 'default' constructors in D, and you specifia

Re: private constructors and inheritance

2014-04-29 Thread ketmar via Digitalmars-d-learn
On Tue, 29 Apr 2014 13:59:28 + John Colvin via Digitalmars-d-learn wrote: > Can someone explain why this can't/doesn't work? Thanks. hm. why it should? there is no 'default' constructors in D, and you specifially made explicit one private (i.e. not visible outside the module). and adding const

Re: private constructors and inheritance

2014-04-29 Thread Andrej Mitrovic via Digitalmars-d-learn
On 4/29/14, Dicebot via Digitalmars-d-learn wrote: > The fact that call to base constructor is not inserted into > templated this()() looks like a bug to me. Just found this, and it might be related: https://issues.dlang.org/show_bug.cgi?id=5770

Re: private constructors and inheritance

2014-04-29 Thread Dicebot via Digitalmars-d-learn
http://dlang.org/class.html#constructors "If no call to constructors via this or super appear in a constructor, and the base class has a constructor, a call to super() is inserted at the beginning of the constructor." The fact that call to base constructor is not inserted into templated this

Re: private constructors and inheritance

2014-04-29 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 29 April 2014 at 13:59:30 UTC, John Colvin wrote: //blah1.d class A { private this(){} } //blah2.d import blah1; class B : A {} $ dmd blah1.d blah2.d -lib Error: constructor blah1.A.this is not accessible from module blah2 Can someone explain why this can't/doesn't work?

private constructors and inheritance

2014-04-29 Thread John Colvin via Digitalmars-d-learn
//blah1.d class A { private this(){} } //blah2.d import blah1; class B : A {} $ dmd blah1.d blah2.d -lib Error: constructor blah1.A.this is not accessible from module blah2 Can someone explain why this can't/doesn't work? Thanks.