www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12829] New: Wrong error line number for closure allocation in

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

          Issue ID: 12829
           Summary: Wrong error line number for closure allocation in
                     nogc function
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main()  nogc {
    int x;
    void delegate()  nogc foo;
    foo = () {
        int y = x;
    };
}


DMD 2.066alpha gives a bad line number that doesn't help me locate where the
closure is defined or created inside the main function:

test.d(1,6): Error: function D main  nogc function allocates a closure with the
GC

--
May 31 2014