using_05.sol 540 B

12345678910111213141516
  1. contract test {
  2. using ints for uint32;
  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, 2);
  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 ----
  14. // error: 6:24-39: using function expects 2 arguments, 3 provided (including self)