[Issue 4076] Wrong error line number with enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 21 13:26:24 PDT 2011


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



--- Comment #3 from bearophile_hugs at eml.cc 2011-09-21 13:25:54 PDT ---
Another test case:


import std.typecons;
void main() {
    enum int N = 10; // line 3
    // lot of code here...
    int[Tuple!(int, int)] aa;
    int x = aa[(1, N)];
}


DMD 2.055 gives:
test.d(3): Error: cannot implicitly convert expression (10) of type int to
Tuple!(int,int)

It's not easy to debug such code.

The bug is in the line:
int x = aa[(1, N)];

Its correct version is:
int x = aa[tuple(1, N)];

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