[Issue 4076] New: Wrong error line number with enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 9 19:57:54 PDT 2010


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

           Summary: Wrong error line number with enum
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-04-09 19:57:53 PDT ---
This is wrong D2 code:

void main() {
    enum double n = 10;
    // *****
    // *****
    // *****
    auto arr = new int[n];
}


dmd 2.043 prints:

test.d(2): Error: cannot implicitly convert expression (10) of type double to
uint

Note the line number of the error. It says 2 and not 6.
If the enum is far away from the line where arr is defined, it's not easy to
understand, find, and fix the bug in the code.

-- 
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