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


--- Comment #0 from bearophile_hugs eml.cc 2014-01-28 08:14:58 PST ---
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