www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19307] New: Variables moved to a closure show nonsense in

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

          Issue ID: 19307
           Summary: Variables moved to a closure show nonsense in debugger
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Keywords: symdeb
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: r.sagitario gmx.de

Compile this program with -g:

int main()
{
        int x = 7;
        auto dg = delegate() {
                return x;
        };
        return dg();
}

and step through it in a debugger: the assignment to x does not seem to do
anyhing, the value of 'x' stays random.

--
Oct 15 2018