The following code does not compile:
type UD60x18 is uint256;
UD60x18 constant SCALE = UD60x18.wrap(1_000000000000000000);
function foo(UD60x18 x) external pure {
assembly {
let remainder := mod(x, SCALE)
}
}
It fails with the following error:
Only direct number constants and references to such constants are supported by inline assembly.
I’m not exactly sure how a constant user-defined value type is interpreted by the compiler (as a literal or not), but IMO the operation above is perfectly legitimate and should be allowed. My user-defined value type is a uint256
.