Would be nice if compiler gave more information!

DigitalDesigns DigitalDesigns at gmail.com
Fri Jun 15 02:19:51 UTC 2018


On Thursday, 14 June 2018 at 12:12:34 UTC, Timon Gehr wrote:
> On 14.06.2018 13:30, DigitalDesigns wrote:
>> 
>> All I know is that using the code
>> 
>> static foreach(a; ["wchar", "ushort"])
>>      mixin("void bar("~a~" value) { foo(); }");
>> 
>> is what is causing it. Manually giving the functions works 
>> fine.
>
> This works:
>
> void foo(){}
> static foreach(a; ["wchar", "ushort"])
>     mixin("void bar("~a~" value) { foo(); }");
>
> If you can give a code snippet that causes the crash, I can 
> probably figure out what's going wrong.

I can't because I have no idea what causes it. I changed the 
mixin to not use the foreach but a CTFE that generates a string 
using the foreach which is then mixed in.


Why can't the compiler give a stack trace? Any information is 
better than none!

I am getting the compiler to crash from a different problem after 
I moved some files around. I have no idea where the error is now.

Why not ship with a debuggable dmd so that when it crashes it can 
be debugged and potentially fixed but at least see where it might 
be crashing.


More information about the Digitalmars-d mailing list