[Issue 8711] New: Missing line number and bad error messages with a wrong functions array initialization

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 23 08:02:34 PDT 2012


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

           Summary: Missing line number and bad error messages with a
                    wrong functions array initialization
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-09-23 08:03:31 PDT ---
This is correct code:

int function(int)[] foos = [x => 0];
void main() {}


This wrong program is the same, but it lacks the []:

int function(int) foos = [x => 0];
void main() {}


DMD 2.061alpha gives on the second program:

temp.d(1): Error: cannot implicitly convert expression (__lambda2) of type int
function(int x) pure nothrow @safe to int(int)
Error: no size for type int(int)


Some problems:
- The first line doesn't seem to mention that foos is not typed as an array.
- The second error message lacks a line number:
- I am not sure that "no size for ..." is correct.

(This bug has severity 'major' as Don asked me for error messages missing line
numbers.)

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