[Issue 4076] Wrong error line number with enum

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4076

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|D1  D2 |D2

--


[Issue 4076] Wrong error line number with enum

2012-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4076


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
   Platform|x86 |All
Version|D2  |D1  D2
 Resolution||WORKSFORME
 OS/Version|Windows |All


--- Comment #4 from yebblies yebbl...@gmail.com 2012-02-04 18:53:54 EST ---
This works with the current compiler (1.072  2.058)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4076] Wrong error line number with enum

2011-09-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4076



--- Comment #3 from bearophile_h...@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: ---


[Issue 4076] Wrong error line number with enum

2011-02-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4076


Max Samukha samu...@voliacable.com changed:

   What|Removed |Added

 CC||samu...@voliacable.com


--- Comment #2 from Max Samukha samu...@voliacable.com 2011-02-15 04:03:49 
PST ---
*** Issue 5588 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4076] Wrong error line number with enum

2010-05-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4076



--- Comment #1 from bearophile_h...@eml.cc 2010-05-12 02:58:08 PDT ---
Another test case:

enum int N = 10; // line 1
void main() {
int[N] arr;
arr[N] = 1; // line 4
}


dmd v2.045 outputs:
test.d(1): Error: array index 10 is out of bounds arr[0 .. 10]
test.d(1): Error: array index 10 is out of bounds arr[0 .. 10]

The line number of the error is wrong, and there is no need to print it two
times. So a better error message can be:

test.d(4): Error: array index 10 is out of bounds arr[0 .. 10]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---