www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12018] New: More descriptive message for frame access error

https://d.puremagic.com/issues/show_bug.cgi?id=12018

           Summary: More descriptive message for frame access error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This is wrong code:

void main() {
    int x;
    static void bar() {
        x++;
    }
}


dmd 2.065beta correctly gives an error message:

test.d(4): Error: static function test.main.bar cannot access frame of function
D main

But I'd like the name 'x' to be present in the error message. Because in a
complex line of code it's not easy to see what variable comes from the outer
scope.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2014