CTFE limitation on reinterpreting cast

monkyyy crazymonkyyy at gmail.com
Mon Sep 28 23:20:17 UTC 2026


On Monday, 28 September 2026 at 23:14:10 UTC, Rambutan wrote:
> On Monday, 28 September 2026 at 22:56:52 UTC, monkyyy wrote:
>> Since its ct and therefore ctfe, the error your getting is 
>> from the colored gc of the ctfe, its largely undocumented but 
>> its mostly implemented ~~to avoid work on bit logic~~ when 
>> someone could imagine how it would compile different on 
>> different architectures
>
> I should have said "is there a way to work around this at 
> compile time?" instead of assuming that was implicit.
>
> The pointer will be no different with or without the cast. If 
> `ptr` is made `__gshared` the symbol name in the resulting 
> object will be no different. With this change it still doesn't 
> compile.

I believe only void* works `void* ptr=cast(void*)&Bobj;`; 
otherwise all the colored gc  will get in your way. Im only aware 
of work around with type synchronicity and I probably have tried 
the hardest


More information about the Digitalmars-d mailing list