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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 14 03:54:50 PDT 2014


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

--- Comment #8 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to yebblies from comment #3)
> (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(...))`.
> 
> assert throws an error and does not violate nothrow.

`assert` is here just because it is where `format` is called. I'm talking about
`format`.

--


More information about the Digitalmars-d-bugs mailing list