IDEA-86896 Magic constant doesn't understand bit flag constants

This commit is contained in:
Alexey Kudravtsev
2012-06-04 13:20:28 +04:00
parent 0316e264fc
commit faf7fc7289
2 changed files with 26 additions and 17 deletions
@@ -244,4 +244,16 @@ public class X {
super.f(x);
}
}
void plusSupportedInFlags(@MagicConstant(flags ={Const.X, Const.Y, Const.Z}) int x) {
////////////// GOOD
plusSupportedInFlags(Const.X + Const.Y);
plusSupportedInFlags(Const.Z + Const.X + Const.Y);
plusSupportedInFlags(Const.Z + (Const.X + Const.Y));
int ix = Const.X + Const.Y;
plusSupportedInFlags(ix);
plusSupportedInFlags(0);
plusSupportedInFlags(-1);
}
}