[Issue 13118] Allow non-`@nogc` stuff in `@nogc` function contracts

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 13 01:06:29 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13118

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc

--- Comment #1 from bearophile_hugs at eml.cc ---
(In reply to Denis Shelomovskij from comment #0)
> This code should compile:
> ---
> void f() @nogc
> in { new int; }
> body { }
> ---
> 
> Note this is already the case for `nothrow` functions as one can throw
> `Exception`s in contracts which allows e.g. use `assert(expr, format(...))`.

I think this is a bad idea. The point of @nogc is to be sure the GC will not be
called or used inside a piece of code. This ER invalidates that. For this ER to
be accepted I'll want a @reallynogc added to D that really forbids the use of
GC.

--


More information about the Digitalmars-d-bugs mailing list