Comment #0 by bearophile_hugs — 2011-06-29T17:06:51Z
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
Comment #1 by andrej.mitrovich — 2013-01-10T14:59:00Z
*** Issue 8157 has been marked as a duplicate of this issue. ***
With https://github.com/dlang/phobos/pull/5401 the recommended approach is:
Foo.x.asOriginalType == Bar.y.asOriginalType
i.e. compare the underlying types if that's what's needed. The plan is to fix this bug by deprecating the current behavior. The error message will recommend using asOriginalType.
Comment #4 by github-bugzilla — 2017-05-23T05:13:50Z