defered new feature

downs default_357-line at yahoo.de
Fri Oct 24 03:57:07 PDT 2008


BCS wrote:
> Reply to Downs,
> 
>> class A { this() { this = new B; } this(Bogus) { } } class B : A {
>> this() { super(bogus); /* rest of constructor */ } }
>>
> 
> to bad it doesn't compile :(
> 
> http://codepad.org/xkBAzQ2c  ->  SEG-V (if you drop the /* */)
> 
> 

gentoo-pc ~ $ cat test113.d && echo "----" && gdc test113.d -o test113 && ./test113
module test113;

typedef bool Bogus;
const Bogus bogus = false;

class A { this() { this = new B; } this(Bogus) { } }
class B : A { this() { super(bogus); /* rest of constructor */ } }

import std.stdio;
void main() { writefln(new A); }
----
test113.B
gentoo-pc ~ $



More information about the Digitalmars-d mailing list