http://d.puremagic.com/issues/show_bug.cgi?id=9128

           Summary: Better error message for method-level/instance-level
                    name confusions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2012-12-09 09:33:55 PST ---
This program:


struct Foo {
    void bar() {
        int spam;
        // Some stuff here.
        this.spam++;
    }
}
void main() {}


DMD2.061alpha gives:

test.d(5): Error: undefined identifier 'spam'


Here spam is a method-level name instead of a instance-level attribute. In
complex methods that error message doesn't give enough help.


So I suggest a better error message, something like:

test.d(4): Error: undefined identifier 'this.spam', did you mean 'spam'?


Other error messages are possible, that mention more explicitly that there is a
method-level identifier with the same name.

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

Reply via email to