Anonymous classes should pass through super ctors

Bruno Medeiros brunodomedeiros+spam at com.gmail
Mon Aug 18 08:33:26 PDT 2008


Jarrett Billingsley wrote:
> "Frank Benoit" <keinfarbton at googlemail.com> wrote in message 
> news:g83v3k$n2u$1 at digitalmars.com...
>> Anonymous classes should pass through super ctors, if no ctor is given.
>>
>> class C {
>>    this( int i ){ .... }
>>    abstract void run();
>>    // ...
>> }
>>
>> auto c = new class(3) C {
>>    this( int a ){ super(a); } //<-- this line should not be necessary.
>>    void run(){}
>> };
> 
> All classes should pass through super ctors.  :| 
> 
> 

Yes, if this was to be fixed/changed, it should be for all classes, not 
just anonymous ones.
I remember this issue (the automatic inheritance of ctors) being 
discussed before. What were the opinions of the community? And Walters? 
(I don't recall myself) If there was something approaching consensus, it 
might be worth opening a bug ticket.

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list