[Issue 15366] Enum typed as bool behaves as bool even when cast

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 21 03:14:33 PST 2015


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

--- Comment #2 from Lionello Lunesu <lio+bugzilla at lunesu.com> ---
Adding an explicit "this." fixed the issue:

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

Something happens when the compiler adds the "this" in your behalf. The
resolution changes.

--


More information about the Digitalmars-d-bugs mailing list