line 3 (2-11):
typing error: can not implicitly cast u64 into u128
Due to this line, pre-typing infers that the rotation operator is applied to a 64-bit value, thus produces a 64-bit value, which cannot be assigned to the 128-bit variable x.
If the rotation operator is manually annotated as <<r 128u, the error is slightly less cryptic:
typing error: invalid operator <<r128u
Note that the discrepancy with shifts (the type-checker is happy with 128-bit shifts, asm-gen complains) makes the error even more confusing.
Pre-typing rejects the following program:
Due to this line, pre-typing infers that the rotation operator is applied to a 64-bit value, thus produces a 64-bit value, which cannot be assigned to the 128-bit variable
x
.If the rotation operator is manually annotated as
<<r 128u
, the error is slightly less cryptic:Note that the discrepancy with shifts (the type-checker is happy with 128-bit shifts, asm-gen complains) makes the error even more confusing.
Reported by @cos-imo.