Howto build a repo case for a ICE?

bearophile bearophileHUGS at lycos.com
Sun Feb 19 07:50:24 PST 2012


Benjamin Thaut:

> Thank you very much that helped a lot. I was able to reduce it to the 
> following code:
> 
> class Foo
> {
> 
>    @property EntityId entityId()
>    {
>      return EntityId(3);
>    }
> 
> }
> 
> struct EntityId
> {
>    uint id;
> 
>    alias id this;
> 
>    this(uint id)
>    {
>      this.id = id;
>    }
> }
> 
> int main(string[] argv)
> {
>    Foo foo = null;
>    auto id = (foo) ? foo.entityId : -1;
> 
>    return 0;
> }

Reduced:

struct Foo {
   uint bar;
   alias bar this;
   this(int) {}
}
void main() {
   auto spam = true ? Foo(1) : 1;
}


Bye,
bearophile


More information about the Digitalmars-d mailing list