using_04.sol 454 B

123456789101112131415
  1. contract test {
  2. using ints for uint64;
  3. function foo(uint32 x) public pure returns (uint64) {
  4. // x is 32 bit but the max function takes 64 bit uint
  5. return x.max(65536);
  6. }
  7. }
  8. library ints {
  9. function max(uint64 a, uint64 b) internal pure returns (uint64) {
  10. return a > b ? a : b;
  11. }
  12. }
  13. // ---- Expect: diagnostics ----