Bug 9250 – Wrong line number for error involving length of a static array

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-01T08:22:00Z
Last change time
2013-01-05T02:19:05Z
Keywords
diagnostic, pull
Assigned to
andrej.mitrovich
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-01-01T08:22:13Z
struct Foo { ubyte u; alias this = u; } void main() { size_t[10] bar; // line 6, error // ... // ... // ... // ... Foo x = bar.length; } DMD 2.061alpha show a wrong line number for the error message, 6 instead of 11: test.d(6): Error: cannot implicitly convert expression (10u) of type uint to Foo
Comment #1 by andrej.mitrovich — 2013-01-01T20:38:21Z
Comment #2 by andrej.mitrovich — 2013-01-04T18:54:04Z
Comment #3 by yebblies — 2013-01-04T23:28:23Z
Comment #4 by yebblies — 2013-01-05T02:17:41Z
This bug doesn't have much to do with assignment, and is most likely not specific to 2.061.
Comment #5 by prouleau001 — 2013-01-05T02:19:05Z
Thanks for clarifying!