strange compilation error

bearophile bearophileHUGS at lycos.com
Sun Mar 9 05:21:17 PDT 2014


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


More information about the Digitalmars-d-learn mailing list