Bug 9768 – No line number for wrong foreach type

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-20T17:13:00Z
Last change time
2013-05-07T14:47:53Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-03-20T17:13:42Z
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.)
Comment #1 by henning — 2013-05-07T12:23:43Z
Comment #2 by github-bugzilla — 2013-05-07T14:08:35Z