Index: reflectable/lib/src/encoding_constants.dart |
diff --git a/reflectable/lib/src/encoding_constants.dart b/reflectable/lib/src/encoding_constants.dart |
index 8d80f61c27ad2582bd976acb6c6db7c528511f45..f29fd35b9fae566b879b0107bdb8282857bc3daf 100644 |
--- a/reflectable/lib/src/encoding_constants.dart |
+++ b/reflectable/lib/src/encoding_constants.dart |
@@ -4,22 +4,23 @@ |
library reflectable.encoding_constants; |
-// The first bits are used to enumerate the "kind" of the declaration. |
-// The more significant bits are flags. |
+// The first `flagsBit-1` bits are used to enumerate the "kind" of the |
+// declaration. The more significant bits are flags. |
+const flagsBit = 4; |
// Kinds: |
const generativeConstructor = 0; |
const factoryConstructor = 1; |
-const redirectingConstructor = 2; |
-const method = 3; |
-const getter = 4; |
-const setter = 5; |
+const method = 2; |
+const getter = 3; |
+const setter = 4; |
// Flags: |
-const staticAttribute = 16; |
-const abstractAttribute = 32; |
-const constAttribute = 64; |
-const privateAttribute = 128; |
-const syntheticAttribute = 256; |
+const staticAttribute = 1 << (flagsBit); |
+const privateAttribute = 1 << (flagsBit + 1); |
+const syntheticAttribute = 1 << (flagsBit + 2); |
+const constAttribute = 1 << (flagsBit + 3); |
+const redirectingConstructor = 1 << (flagsBit + 4); |
+const abstractAttribute = 1 << (flagsBit + 5); |
-int kindFromEncoding(int encoding) => encoding & 15; |
+int kindFromEncoding(int encoding) => encoding & ((1 << flagsBit) - 1); |