Self-referential struct mixins

rbscott tjonsies818 at
Sun Nov 17 19:32:58 UTC 2019

On Sunday, 17 November 2019 at 17:35:07 UTC, Elie Morisse wrote:
> It's part of a bigger family of issues caused by how DMD's 
> semantic analysis is architectured. I tried to tackle it some 
> time ago but didn't see it through the end :
> As I see it the proper fix requires rewritting a large part of 
> the compiler frontend, but this is definitely something worth 
> doing at some point to make DMD less brittle esp. regarding 
> advanced usage of mixins/CTFE (I don't have time anymore, and 
> IMHO someone should be paid 2 months to work full-time on 
> re-architecturing DMD for this)

Thanks for pointing that out. Given what you understand about the 
issue, do you have any recommendations for working around this? I 
am pretty sure a string mixin will work, but hopefully there is 
an alternative. Maybe a different compiler will work?

> Forward declaring structs isn't allowed in D.

I did try forward declarations. I thought because of "Opaque 
Pointers", this would work, but it generates a compiler error.

More information about the Digitalmars-d mailing list