www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13118] New: Allow non-` nogc` stuff in ` nogc` function

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

          Issue ID: 13118
           Summary: Allow non-` nogc` stuff in ` nogc` function contracts
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

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(...))`.

--
Jul 13 2014