www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13113] New: cannot build druntime's gc.d with

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

          Issue ID: 13113
           Summary: cannot build druntime's gc.d with -debug=INVARIANT,
                    bad  nogc inference?
           Product: D
           Version: unspecified
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: r.sagitario gmx.de

When trying to compile gc.d from druntime with -debug=INVARIANT, I get the
following error:

gc.d(1367): Error:  nogc function 'gc.gc.Gcx.~this' cannot call non- nogc
function 'gc.gc.Gcx.__invariant'

I've tried reduce this, here's what I get for

//////////////////////
class Gcx
{
    ~this()    {}

    invariant()
    {
        foreach(t; tr) {}
    }

    Treap!int tr;
}

struct Treap(E)
{
nothrow:
    E e;

    ~this() {}

    int opApply(scope int delegate(const ref E) nothrow dg) const
    {
        return 1;
    }
}
///////////////////////

Error: pure function 'nogcinv.Gcx.~this' cannot call impure function
'nogcinv.Gcx.__invariant'
nogcinv.d(5): Error: safe function 'nogcinv.Gcx.~this' cannot call system
function 'nogcinv.Gcx.__invariant'
nogcinv.d(5): Error:  nogc function 'nogcinv.Gcx.~this' cannot call non- nogc
function 'nogcinv.Gcx.__invariant'

--
Jul 12 2014