debugging mixins

Manu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 3 18:20:01 PDT 2016


On 4 October 2016 at 04:21, Stefan Koch via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Monday, 3 October 2016 at 15:23:40 UTC, Jonathan Marler wrote:
>
>>
>> Yes, having the mixins expanded without the surrounding code would make it
>> difficult to debug in some cases.  Maybe generating the entire source with
>> the expanded mixins is another option?
>>
>> mycode.d
>> obj/mycode_processed.d
>
> That was my intention.
>>
>> Maybe this idea could also be expanded to template instantiation?
>
>  Oh yes. it is not that more much work :)

What case of template instantiation where there are no mixins involved
would this make significantly simpler to debug? (I don't know this is
a critical debugability problem as it is...)
Do you mean just substituting 'T' with actual types? resolving static
if's? Hard to know what it should do...

Actually, one case that often bites me is static-foreach unrolling.
That's borderline impossible to debug.
foreach(m; __traits(allMembers,T)) is the classic impossible to debug case.


More information about the Digitalmars-d mailing list