www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14269] New: Enum is not implicitly converted to base type

https://issues.dlang.org/show_bug.cgi?id=14269

          Issue ID: 14269
           Summary: Enum is not implicitly converted to base type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: monkeyworks12 hotmail.com

The following code compiles with 2.066.1 and lower but does not compile with
2.067 Beta 3.

enum Bits: ulong
{
    none = 0
}

bool hasBit(ref ulong rBits, ulong rBit)
{
    return cast(bool)(rBits & rBit);
}

void main()
{
    Bits bits;
    hasBit(bits, Bits.none);
}

--
Mar 10 2015