zserio
zserio copied to clipboard
Bitmasks based on dynamic bifield using 64-bit expression generates uncompilable Java code
The following schema generates uncompilable Java code:
const uint64 NUM_BITS = 3;
bitmask bit<NUM_BITS> Permission
{
NONE = 000b,
READ = 010b,
WRITE
};
The generated Java code fails to compile with the following error:
[javac] Permission.java:28: error: incompatible types: BigInteger cannot be converted to int
[javac] value = (byte)in.readBits((int)(NUM_BITS.NUM_BITS));
[javac] ^