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

          Issue ID: 13835
           Summary: ICE in interpret.c:736 - Issue with static variables.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

class Foo(T)
{
    private T* _data;

    final private void siftUp(int position) nothrow
    {
        static T crash = *(this._data + position);
    }
}

void main(string[] args)
{
    auto heap = new Foo!(int);
}

Compiler output:

rdmd --force -de -debug -w test.d
dmd: interpret.c:736: Expression* ctfeInterpret(Expression*): Assertion
`global.errors != olderrors' failed.
Failed: ["dmd", "-de", "-debug", "-w", "-v", "-o-", "test.d", "-I."]

Remove the static keyword and it compiles fine.

--

Reply via email to