www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12337] New: Bad enum usage wrong error message line number

https://d.puremagic.com/issues/show_bug.cgi?id=12337

           Summary: Bad enum usage wrong error message line number
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2014-03-10 10:59:47 PDT ---
This is wrong code:


enum Foo : ubyte { A, B }
void main() {
    Foo x = Foo.A | Foo.B;
}



dmd 2.066alpha gives an error message on the wrong line:

test.d(1,20): Error: cannot implicitly convert expression (1) of type int to
Foo

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