Howto build a repo case for a ICE?

Benjamin Thaut code at
Sun Feb 19 07:41:56 PST 2012

Am 19.02.2012 15:41, schrieb Don:
> On 19.02.2012 14:24, Benjamin Thaut wrote:
>> The last dmd version I could use to actually build my project was dmd
>> 2.056. Now I want to help finding those bugs that keep me from compiling
>> and I'm wondering how I can build repro cases for the ICEs I encounter.
>> I tried compiling with -v but that does not really give much information
>> about where the crash actually happens. So I wonder what can actually be
>> done to find the part of the code or even only the module it crashes in?
>> The current ICE I'm encountering is:
>> Assertion failure: 't1->ty == t2->ty' on line 2082 in file 'cast.c'
> If you don't mind building the compiler,
> add this line just before 2082:
> if (t1->ty != t2->ty) e1->error("ICE");
> and then build the compiler.
> Sorry for the newbie-hostile comment. But it would save you a lot of time.

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)
   { = id;

int main(string[] argv)
   Foo foo = null;
   auto id = (foo) ? foo.entityId : -1;

   return 0;

More information about the Digitalmars-d mailing list