www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6227] New: Comparison of different enums

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6227

           Summary: Comparison of different enums
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



I think comparisons of different enums may hide bugs (this compiles with no
errors on DMD 2.053):


enum Foo { x }
enum Bar { y }
void main() {
    auto b = Foo.x == Bar.y;
}


A less visible to spot case:

enum { X }
enum { Y }
void main() {
    auto b = X == Y;
}


See also bug 3999

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 29 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6227




14:59:00 PST ---
*** Issue 8157 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: -------
Jan 10 2013