[Issue 9572] New: Missed wrong implicit integral conversion
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 22 11:09:12 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9572
Summary: Missed wrong implicit integral conversion
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid, 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 2013-02-22 11:09:10 PST ---
void main() {
int[300] data;
foreach (ubyte i, x; data) {} // Line 3, no error.
ubyte j = data.length; // Line 4, Error.
}
DMD 2.063alpha gives:
temp.d(4): Error: cannot implicitly convert expression (300u) of type uint to
ubyte
But line 3 should give a similar error message, because data has 300 items, so
the "i" index can't represent all the possible indexes.
See also issue 9570.
--
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