[Issue 9635] New: Improved error message for failed access of array field properties from static method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 2 12:08:04 PST 2013


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

           Summary: Improved error message for failed access of array
                    field properties from static method
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-03-02 12:08:03 PST ---
Spinoff of issue 9630


This program:

struct Foo {
    int i[1];
    static void bar() {
        assert(0 < i[0].max);
    }
}


Currently gives:

temp.d(4): Error: need 'this' for i type int[1u].


Andrej Mitrovic suggests:

> This is already a bad message. 'i' should be quoted and the wording should be
> improved:
> temp.d(4): Error: need 'this' for 'i' of type int[1u]


Is it possible to generate an error message like this, that suggests how to fix
the problem?

temp.d(4): Error: need 'this' for 'i' of type int[1u]. Use typeof(i[0]).max
instead

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


More information about the Digitalmars-d-bugs mailing list