[Issue 9768] New: No line number for wrong foreach type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 20 17:13:44 PDT 2013


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

           Summary: No line number for wrong foreach type
           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 2013-03-20 17:13:42 PDT ---
This is a wrong program:


import std.typecons: Tuple;
void main() {
    Tuple!(string, int)[] data;
    foreach (string first, second; data) {}
}



DMD 2.063alpha gives an error with no line number:

Error: cannot implicitly convert expression (0) of type int to string
test.d(4): Error: incompatible types for ((__key1671) < (__aggr1672.length)):
'string' and 'uint'
test.d(4): Error: '__key1671 += 1' is not a scalar, it is a string
test.d(4): Error: incompatible types for ((__key1671) += (1)): 'string' and
'int'
test.d(4): Error: cannot implicitly convert expression (__key1671) of type
string to uint


(Tagged with major priority according to a request by Don for errors with no
line number.)

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