Closed controlflow closed 9 years ago
What is the snippet?
To be clear, if you have enum like this:
[Flags]
enum E {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
BC = B | C
}
When you complete BC
fake member over value of type E
, you will get:
void M(E e) {
if ((e & E.BC) != 0) { }
}
This is wrong :) Right way was:
void M(E e) {
if ((e & E.BC) == E.BC) { }
}
:+1:
Fixed in upcoming 2.2
When enum case takes >1 bit, should emit