November 20, 2015

          Issue ID: 15366
           Summary: Enum typed as bool behaves as bool even when cast
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd

enum Enum : bool { A, B };
struct I{
  void func(Enum e);
  void func2(Enum a, Enum b) {func(cast(Enum)(a&&b));}  //line 4

test.d(4): Error: function test.I.func (Enum e) is not callable using argument
types (bool)

There are many changes to this code that will get rid of the error:
 * placing any one, or both, of the functions on global scope
 * using bitwise & instead of logic &&
 * removing the type from the enum, or typing as byte/int/...