Ref / NotNull struct

Simen Kjaeraas simen.kjaras at gmail.com
Sun May 6 07:04:30 PDT 2012



> I would be glad for criticism and suggestions and maybe a  
> solution/workaround for the infinite loop bug, if it's the case, that  
> it's really a bug.

First thought (after just copying the code and compiling it, not reading  
the
post :p), was 'where are the unittest blocks?' Then I saw you had a  
separate
module.

As for the infinite loop bug, consider this:

class A {
     B b;
     alias b this;
}

class B {
     A a;
     alias a this;
}

void main( ) {
     A a = 3;
}

This fails with the exact same message.

The compiler goes 'Eh, no int in A. But ooh, there's an alias this here!'
'Eh, no int in B. But ooh, there's an alias this here!'
Repeat as necessary.

Filed as 8053:
http://d.puremagic.com/issues/show_bug.cgi?id=8053


More information about the Digitalmars-d-learn mailing list