CTFE limitation on reinterpreting cast

Kapendev alexandroskapretsos at gmail.com
Tue Sep 29 19:01:45 UTC 2026


On Tuesday, 29 September 2026 at 18:43:04 UTC, monkyyy wrote:
> On Tuesday, 29 September 2026 at 11:19:15 UTC, user1234 wrote:
>> 
>> I think this is not related to CTFE,
>
> Terrible take, that error message is literally labeled "ctfe" 
> and its the "the ctfe gc is unhappy" error message. Theres a 
> colored gc for ctfe, thats mostly undocumented, trust your eyes 
> over the spec. Error messages tell you that a specific code 
> branch was unhappy. Even if the spec didnt say `Any pointer may 
> be cast to void* and from void* back to its original type.` on 
> its cope list 
> https://dlang.org/spec/function.html#interpretation ; the error 
> message is more real.

Monkeyy is right and knows how to read. It's a classic CTFE 
error. I say classic because it's one of those things you will 
try one day while doing metaprogramming.


More information about the Digitalmars-d mailing list