strange compilation error

Jack Applegame japplegame at gmail.com
Sun Mar 9 07:54:29 PDT 2014


On Sunday, 9 March 2014 at 12:21:18 UTC, bearophile wrote:
> Jack Applegame:
>
>> This fails to compile
>> http://dpaste.dzfl.pl/e9a90e808af4
>
> There are various ways to avoid this problem, using static 
> classes/structs is one of the simplest:
>
> void main() {
>     static class B {
>         int a;
>         this(int aa) { a = aa; }
>     }
>     auto foo = {
>         return new B(1);
>     };
> }
>
> Bye,
> bearophile

thanks



More information about the Digitalmars-d-learn mailing list