www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15100] New: nogc should ignore allocations on assertion fail

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

          Issue ID: 15100
           Summary:  nogc should ignore allocations on assertion fail
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: jack jackstouffer.com

per Steven Schveighoffer's suggestions

e.g. this should be allowed

void main()  nogc
{
    import std.algorithm.sorting : isSorted;
    import std.conv: text;

    static immutable arr = [1, 2, 3, 4];
    assert(isSorted(arr), "value " ~ text(arr) ~ " is not sorted");
}

--
Sep 22 2015