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

--- Comment #2 from Denis Shelomovskij <verylonglogin....@gmail.com> ---
(In reply to bearophile_hugs from comment #1)
> (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.

I don't see any difference here with `nothrow` which can be violated in
contracts allowing e.g. `format` calls.

--

Reply via email to