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: [email protected]
          Reporter: [email protected]

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.

--

Reply via email to