Currently, if one tries to create a UIntType8 (or 16, 32, 64, or anything that ultimately relies on ByteUtils.java) with more than 8 bits (or 2 bytes), then the exception thrown is not helpful. E.g., this code:
new UInt8Type(UnsignedLong.valueOf(500));
yields this exception: java.lang.IllegalArgumentException: invalid count: -1
Instead, the error emission should indicate something about bit legnth. This actually can be handled by improving the error emission in ByteUtils#padded and adding better test coverage, in particular asserting on the error message here.
Currently, if one tries to create a
UIntType8
(or 16, 32, 64, or anything that ultimately relies on ByteUtils.java) with more than 8 bits (or 2 bytes), then the exception thrown is not helpful. E.g., this code:yields this exception:
java.lang.IllegalArgumentException: invalid count: -1
Instead, the error emission should indicate something about bit legnth. This actually can be handled by improving the error emission in
ByteUtils#padded
and adding better test coverage, in particular asserting on the error message here.