"Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Apr 10 11:30:14 UTC 2024


On 10/04/2024 2:50 PM, Liam McGillivray wrote:
> On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> The string mixin triggers CTFE, if ``EnumPrefixes`` wasn't templated, 
>> that would cause codegen and hence error. If you called it in a 
>> context that wasn't CTFE only, it would codegen even with template and 
>> would error.
>>
>> For quite a long time we emitted -betterC errors during semantic, we 
>> learned that this was all around a bad idea and moved (hopefully all 
>> but I doubt it) into the glue code. So only if it codegens will it error.
> 
> Well then, perhaps this is a bug (though a useful bug in my case).

Not a bug, this took us quite a while to get reliable.



More information about the Digitalmars-d-learn mailing list