Skip to content

Commit 4ef8622

Browse files
committed
Fix issue where larger than bytes8 could not be casted to int
1 parent 2412182 commit 4ef8622

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/utils/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export function explicitlyCastable(from?: Type, to?: Type): boolean {
9393
}
9494

9595
if (from instanceof BytesType) {
96-
// Can cast unbounded bytes or <=4 bytes to int
97-
if (to === PrimitiveType.INT) return !from.bound || from.bound <= 8;
96+
// Can cast any bytes to int
97+
if (to === PrimitiveType.INT) return true;
9898
// Can't cast bytes to bool or string
9999
if (to === PrimitiveType.BOOL) return false;
100100
if (to === PrimitiveType.STRING) return false;

0 commit comments

Comments
 (0)