<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>I have a module which is completelly @nogc, and as such I'd like to just say<br><br></div>   @nogc:<br><br></div>at the top of the file and be happy.<br>

<br></div>However, my unit tests for this same module do some GC allocation, so the module fails to compile.<br><br></div>Is there a way to disable @nogc for the unit tests only? Would this be a bad idea in some way I cannot see?<br>

<br></div><div>I suppose the same question is valid for other attributes, like 'nothrow' and '@safe'.<br><br></div><div>Thank you,<br><br></div><div>LMB<br><br></div></div>