Dicebot:

So this has something to do with _initialization_ of class members with delegates/lambdas, not their very existence.


So is it worth adding this diagnostic bug report in Bugzilla?


class Foo {
    void delegate() dg1;
    void delegate() dg2 = delegate(){};
    this() {
        this.dg1 = (){};
    }
}
void main() {
    auto f = new Foo;
}



DMD 2.064alpha gives:

temp.d(3): Error: delegate temp.Foo.__dgliteral1 function literals cannot be class members temp.d(3): Error: cannot implicitly convert expression (__dgliteral1) of type _error_ delegate() to void delegate()


Bye,
bearophile

Reply via email to