flag -ignore_nogc to allow breaking nogc rules during debugging [analog to debug for pure]

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 10 01:56:16 PST 2016


On Sunday, 10 January 2016 at 09:17:20 UTC, Timothee Cour wrote:
> this would make error handling trivial and solve issues such as 
> this:
>
> FORUM:formatted assert error messages inside nogc functions 
> http://forum.dlang.org/thread/CANri+EyNyrhMWGCSqZHx_vXDJFSrwhOrV=J2kaTZ6t9-upTAtg@mail.gmail.com
>
> usage:
>
> during development:
> dmd -debug -ignore_nogc other_flags foo.d
> during release:
> dmd other_flags foo.d
>
> @nogc
> void test(int a){
>
> version(ignore_nogc)
>   assert(a==1, text("a = ", a));
> else
>   assert(a==1, "a = ?");
>
> }

is there a valid reason that debug shouldn't just ignore @nogc?
this is also an issue with contracts iirc


More information about the Digitalmars-d mailing list