Contract error string generation is not implicitly @nogc

IGotD- nise at nise.com
Sun Sep 4 15:05:45 UTC 2022


On Sunday, 4 September 2022 at 14:54:52 UTC, Paul Backus wrote:
>
> If the GC is totally disabled (like in BetterC), the expression 
> `"Invalid " ~ s` will not even compile in the first place. So 
> you would need to create your error message some other way 
> (perhaps with malloc).

Which make me wonder if the @nogc attribute is totally 
unnecessary. What if we are using reference counting which only 
needs malloc/free, then it might be acceptable. Wouldn't it be 
better if we get an error like GCBohem.Allocate symbol isn't 
found, the reason would be obvious.

Then you might ban GC from specific functions which perhaps is 
you want. However, suddenly we have fringe desires like in this 
thread.


More information about the Digitalmars-d mailing list