[Issue 15089] New: Marks wrong line as where error occurs.
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Sep 20 10:58:24 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=15089
Issue ID: 15089
Summary: Marks wrong line as where error occurs.
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: jjohnsonjj1251 at gmail.com
Code:
enum Pieces : ubyte
{
Empty,
Pawn,
Rook,
Knight,
Bishop,
Queen,
King
}
int color = 0b10000000;
...
byte[64] pieces;
...
pieces[i] = color ^ Pieces.Rook;
Explanation:
The compiler marked the error as occurring in the enum saying that 129 was too
large to store in a byte when the error should have occurred in the last line
where 129 was actually being assigned to a byte value.
--
More information about the Digitalmars-d-bugs
mailing list